Hibernate ORM JoinedSubclass - 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 JoinedSubclass 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);
	} 
	 
} 
Full Snippet Info
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:
	@Test
	public void testProperCallbacks() { 
		PersistentClassVisitorValidator vv = new PersistentClassVisitorValidator();
		new RootClass().accept( vv );
		new Subclass( new RootClass() ).accept( vv );
		new JoinedSubclass( new RootClass() ).accept( vv );
		new SingleTableSubclass( new RootClass() ).accept( vv );
		new UnionSubclass( new RootClass() ).accept( vv );
	} 
 
	static public class PersistentClassVisitorValidator implements PersistentClassVisitor {
 
		private Object validate(Class expectedClass, Object visitee) {
			if (!visitee.getClass().getName().equals(expectedClass.getName())) {
				throw new IllegalStateException(visitee.getClass().getName()
						+ " did not call proper accept method. Was " 
						+ expectedClass.getName());
			} 
			return null; 
		} 
Full Snippet Info
4
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( 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) {
		return new EntityBinding( rootMetadata( inheritanceType ) );
	} 
} 
Full Snippet Info
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java