use of org.hibernate.mapping.RootClass 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.RootClass in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetEntityName.
@Test
public void testGetEntityName() {
SimpleValue simpleValueTarget = new SimpleValue(null);
valueFacade = FACADE_FACTORY.createValue(simpleValueTarget);
assertNull(valueFacade.getEntityName());
RootClass pc = new RootClass();
pc.setEntityName("foobar");
OneToOne oneToOneTarget = new OneToOne(null, null, pc);
valueFacade = FACADE_FACTORY.createValue(oneToOneTarget);
assertEquals("foobar", valueFacade.getEntityName());
}
use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetParentProperty.
@Test
public void testGetParentProperty() {
Component componentTarget = new Component(null, new RootClass());
IValue valueFacade = FACADE_FACTORY.createValue(componentTarget);
assertNull(valueFacade.getParentProperty());
componentTarget.setParentProperty("foobar");
assertEquals("foobar", valueFacade.getParentProperty());
}
use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetOwner.
@Test
public void testGetOwner() {
RootClass rc = new RootClass();
Component componentTarget = new Component(null, rc);
valueFacade = FACADE_FACTORY.createValue(componentTarget);
assertSame(rc, ((IFacade) valueFacade.getOwner()).getTarget());
}
use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsToOne.
@Test
public void testIsToOne() {
valueTarget = new SimpleValue(null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
assertFalse(valueFacade.isToOne());
ToOne toOne = new OneToOne(null, null, new RootClass());
valueFacade = FACADE_FACTORY.createValue(toOne);
assertTrue(valueFacade.isToOne());
}
Aggregations