use of org.hibernate.mapping.SingleTableSubclass in project jbosstools-hibernate by jbosstools.
the class PersistentClassFacadeTest method testIsAssignableToRootClass.
@Test
public void testIsAssignableToRootClass() {
persistentClassTarget = new SingleTableSubclass(new RootClass(null), null);
persistentClassFacade = new PersistentClassFacadeImpl(FACADE_FACTORY, persistentClassTarget);
assertFalse(persistentClassFacade.isAssignableToRootClass());
persistentClassTarget = new RootClass(null);
persistentClassFacade = new PersistentClassFacadeImpl(FACADE_FACTORY, persistentClassTarget);
assertTrue(persistentClassFacade.isAssignableToRootClass());
}
use of org.hibernate.mapping.SingleTableSubclass in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewSingleTableSubclass.
@Test
public void testNewSingleTableSubclass() {
IPersistentClass persistentClass = service.newRootClass();
IPersistentClass singleTableSublass = service.newSingleTableSubclass(persistentClass);
assertNotNull(singleTableSublass);
Object target = ((IFacade) singleTableSublass).getTarget();
assertNotNull(target);
assertTrue(target instanceof SingleTableSubclass);
assertSame(persistentClass, singleTableSublass.getSuperclass());
assertSame(((IFacade) persistentClass).getTarget(), ((SingleTableSubclass) target).getSuperclass());
}
use of org.hibernate.mapping.SingleTableSubclass in project jbosstools-hibernate by jbosstools.
the class PersistentClassFacadeTest method testIsAssignableToRootClass.
@Test
public void testIsAssignableToRootClass() {
persistentClassTarget = new SingleTableSubclass(new RootClass(null), null);
persistentClassFacade = new PersistentClassFacadeImpl(FACADE_FACTORY, persistentClassTarget);
assertFalse(persistentClassFacade.isAssignableToRootClass());
persistentClassTarget = new RootClass(null);
persistentClassFacade = new PersistentClassFacadeImpl(FACADE_FACTORY, persistentClassTarget);
assertTrue(persistentClassFacade.isAssignableToRootClass());
}
use of org.hibernate.mapping.SingleTableSubclass in project jbosstools-hibernate by jbosstools.
the class PersistentClassFacadeTest method testIsAssignableToRootClass.
@Test
public void testIsAssignableToRootClass() {
persistentClassTarget = new SingleTableSubclass(new RootClass(DummyMetadataBuildingContext.INSTANCE), DummyMetadataBuildingContext.INSTANCE);
persistentClassFacade = new PersistentClassFacadeImpl(FACADE_FACTORY, persistentClassTarget);
assertFalse(persistentClassFacade.isAssignableToRootClass());
persistentClassTarget = new RootClass(DummyMetadataBuildingContext.INSTANCE);
persistentClassFacade = new PersistentClassFacadeImpl(FACADE_FACTORY, persistentClassTarget);
assertTrue(persistentClassFacade.isAssignableToRootClass());
}
use of org.hibernate.mapping.SingleTableSubclass in project jbosstools-hibernate by jbosstools.
the class PersistentClassFacadeTest method testIsRootClass.
@Test
public void testIsRootClass() {
persistentClassTarget = new SingleTableSubclass(new RootClass());
persistentClassFacade = new PersistentClassFacadeImpl(FACADE_FACTORY, persistentClassTarget);
assertFalse(persistentClassFacade.isRootClass());
persistentClassTarget = new RootClass();
persistentClassFacade = new PersistentClassFacadeImpl(FACADE_FACTORY, persistentClassTarget);
assertTrue(persistentClassFacade.isRootClass());
}
Aggregations