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 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 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 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());
}
Aggregations