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());
}
use of org.hibernate.mapping.JoinedSubclass in project jbosstools-hibernate by jbosstools.
the class ServiceImpl method newJoinedSubclass.
@Override
public IPersistentClass newJoinedSubclass(IPersistentClass persistentClass) {
assert persistentClass instanceof IFacade;
IPersistentClass result = facadeFactory.createPersistentClass(new JoinedSubclass((PersistentClass) ((IFacade) persistentClass).getTarget(), null));
((AbstractPersistentClassFacade) result).setSuperClass(persistentClass);
return result;
}
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 testIsInstanceOfJoinedSubclass.
@Test
public void testIsInstanceOfJoinedSubclass() {
assertFalse(persistentClassFacade.isInstanceOfJoinedSubclass());
JoinedSubclass joinedSubclassTarget = new JoinedSubclass(persistentClassTarget, null);
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(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