use of org.hibernate.mapping.JoinedSubclass in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewJoinedSubclass.
@Test
public void testNewJoinedSubclass() {
IPersistentClass persistentClass = service.newRootClass();
IPersistentClass joinedSubclass = service.newJoinedSubclass(persistentClass);
assertNotNull(joinedSubclass);
Object target = ((IFacade) joinedSubclass).getTarget();
assertNotNull(target);
assertTrue(target instanceof JoinedSubclass);
assertSame(persistentClass, joinedSubclass.getSuperclass());
assertSame(((IFacade) persistentClass).getTarget(), ((JoinedSubclass) target).getSuperclass());
}
use of org.hibernate.mapping.JoinedSubclass in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewJoinedSubclass.
@Test
public void testNewJoinedSubclass() {
IPersistentClass persistentClass = service.newRootClass();
IPersistentClass joinedSubclass = service.newJoinedSubclass(persistentClass);
assertNotNull(joinedSubclass);
Object target = ((IFacade) joinedSubclass).getTarget();
assertNotNull(target);
assertTrue(target instanceof JoinedSubclass);
assertSame(persistentClass, joinedSubclass.getSuperclass());
assertSame(((IFacade) persistentClass).getTarget(), ((JoinedSubclass) target).getSuperclass());
}
use of org.hibernate.mapping.JoinedSubclass in project jbosstools-hibernate by jbosstools.
the class PersistentClassFacadeTest method testIsInstanceOfJoinedSubclass.
@Test
public void testIsInstanceOfJoinedSubclass() {
assertFalse(persistentClassFacade.isInstanceOfJoinedSubclass());
JoinedSubclass joinedSubclassTarget = new JoinedSubclass(persistentClassTarget);
IPersistentClass joinedSubclassFacade = new PersistentClassFacadeImpl(FACADE_FACTORY, joinedSubclassTarget);
assertTrue(joinedSubclassFacade.isInstanceOfJoinedSubclass());
}
use of org.hibernate.mapping.JoinedSubclass in project jbosstools-hibernate by jbosstools.
the class PersistentClassFacadeTest method testIsJoinedSubclass.
@Test
public void testIsJoinedSubclass() {
persistentClassFacade = new PersistentClassFacadeImpl(FACADE_FACTORY, new RootClass());
assertFalse(persistentClassFacade.isJoinedSubclass());
Table rootTable = new Table();
Table subTable = new Table();
RootClass rootClass = new RootClass();
rootClass.setTable(rootTable);
JoinedSubclass subclass = new JoinedSubclass(rootClass);
subclass.setTable(subTable);
persistentClassFacade = new PersistentClassFacadeImpl(FACADE_FACTORY, subclass);
assertTrue(persistentClassFacade.isJoinedSubclass());
subclass.setTable(rootTable);
assertFalse(persistentClassFacade.isJoinedSubclass());
}
use of org.hibernate.mapping.JoinedSubclass in project jbosstools-hibernate by jbosstools.
the class PersistentClassFacadeTest method testIsJoinedSubclass.
@Test
public void testIsJoinedSubclass() {
persistentClassFacade = new PersistentClassFacadeImpl(FACADE_FACTORY, new RootClass(null));
assertFalse(persistentClassFacade.isJoinedSubclass());
Table rootTable = new Table();
Table subTable = new Table();
RootClass rootClass = new RootClass(null);
rootClass.setTable(rootTable);
JoinedSubclass subclass = new JoinedSubclass(rootClass, null);
subclass.setTable(subTable);
persistentClassFacade = new PersistentClassFacadeImpl(FACADE_FACTORY, subclass);
assertTrue(persistentClassFacade.isJoinedSubclass());
subclass.setTable(rootTable);
assertFalse(persistentClassFacade.isJoinedSubclass());
}
Aggregations