use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class SpecialRootClassFacadeTest method beforeEach.
@BeforeEach
public void beforeEach() {
PersistentClass persistentClassTarget = new RootClass(null);
Property propertyTarget = new Property();
propertyTarget.setPersistentClass(persistentClassTarget);
specialRootClassFacade = new SpecialRootClassFacadeImpl(FACADE_FACTORY, FACADE_FACTORY.createProperty(propertyTarget));
}
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(null));
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 testGetPropertyIterator.
@Test
public void testGetPropertyIterator() {
Component componentTarget = new Component(null, new RootClass(null));
valueFacade = FACADE_FACTORY.createValue(componentTarget);
Iterator<IProperty> iter = valueFacade.getPropertyIterator();
assertFalse(iter.hasNext());
Property propertyTarget = new Property();
componentTarget.addProperty(propertyTarget);
valueFacade = FACADE_FACTORY.createValue(componentTarget);
iter = valueFacade.getPropertyIterator();
assertTrue(iter.hasNext());
IProperty propertyFacade = iter.next();
assertSame(propertyTarget, ((IFacade) propertyFacade).getTarget());
}
use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsEmbedded.
@Test
public void testIsEmbedded() {
valueTarget = new SimpleValue(null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
assertNull(valueFacade.isEmbedded());
Component component = new Component(null, new RootClass(null));
valueFacade = FACADE_FACTORY.createValue(component);
component.setEmbedded(true);
assertTrue(valueFacade.isEmbedded());
component.setEmbedded(false);
assertFalse(valueFacade.isEmbedded());
}
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(null);
pc.setEntityName("foobar");
OneToOne oneToOneTarget = new OneToOne(null, null, pc);
valueFacade = FACADE_FACTORY.createValue(oneToOneTarget);
assertEquals("foobar", valueFacade.getEntityName());
}
Aggregations