Hibernate ORM UnionSubclass - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM UnionSubclass class.

This code example shows how to use the following methods:
	public void testNeedsTable(){ 
		Cfg2HbmTool c2h = new Cfg2HbmTool();
		PersistentClass pc = new RootClass();
		assertTrue(c2h.needsTable(pc));
		assertTrue(c2h.needsTable(new JoinedSubclass(pc)));
		assertTrue(c2h.needsTable(new UnionSubclass(pc)));
		assertFalse(c2h.needsTable(new SingleTableSubclass(pc)));
		assertFalse(c2h.needsTable(new Subclass(pc)));
				 
	} 
	 
	public static Test suite() {
		return new TestSuite(Cfg2HbmToolTest.class);
	} 
	 
} 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
		assertThat( resolver.getEntityPersisterClass( subclass ) ).isEqualTo( SingleTableOgmEntityPersister.class );
	} 
 
	@Test
	public void testTablePerClassPersistentSubclassStrategy() throws Exception {
		Subclass subclass = new UnionSubclass( new RootClass() );
		assertThat( resolver.getEntityPersisterClass( subclass ) ).isEqualTo( UnionSubclassOgmEntityPersister.class );
	} 
 
	@Test(expected = UnsupportedOperationException.class)
	public void testPersistenceClassSubclassJoinedStrategy() throws Exception {
		Subclass subclass = new JoinedSubclass( new RootClass() );
		resolver.getEntityPersisterClass( subclass );
	} 
 
	private EntityBinding rootMetadata(InheritanceType inheritanceType) {
		return new EntityBinding( inheritanceType, null );
	} 
 
	private EntityBinding subclassMetadata(InheritanceType inheritanceType) {
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java