use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class Cfg2HbmToolFacadeTest method testGetTagPersistentClass.
@Test
public void testGetTagPersistentClass() {
PersistentClass target = new RootClass();
IPersistentClass persistentClass = FACADE_FACTORY.createPersistentClass(target);
assertEquals("class", cfg2HbmToolFacade.getTag(persistentClass));
}
use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class Cfg2HbmToolFacadeTest method testGetTagProperty.
@Test
public void testGetTagProperty() throws Exception {
RootClass rc = new RootClass();
Property p = new Property();
Table t = new Table();
SimpleValue sv = new SimpleValue(null, t);
sv.setTypeName("foobar");
p.setValue(sv);
p.setPersistentClass(rc);
rc.setVersion(p);
IProperty property = new AbstractPropertyFacade(FACADE_FACTORY, p) {
};
assertEquals("version", cfg2HbmToolFacade.getTag(property));
}
use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewSpecialRootClass.
@Test
public void testNewSpecialRootClass() {
IProperty property = service.newProperty();
IPersistentClass pc = service.newRootClass();
property.setPersistentClass(pc);
IPersistentClass specialRootClass = service.newSpecialRootClass(property);
assertNotNull(specialRootClass);
Object target = ((IFacade) specialRootClass).getTarget();
assertNotNull(target);
assertTrue(target instanceof RootClass);
assertSame(property, specialRootClass.getProperty());
}
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());
}
Aggregations