use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetComponentClassName.
@Test
public void testGetComponentClassName() {
Component valueTarget = new Component(null, new RootClass(null));
valueFacade = FACADE_FACTORY.createValue(valueTarget);
assertNull(valueFacade.getComponentClassName());
valueTarget.setComponentClassName("org.foo.Bar");
assertEquals("org.foo.Bar", valueFacade.getComponentClassName());
}
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(null);
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(null);
Property p = new Property();
Table t = new Table();
SimpleValue sv = new SimpleValue(createMetadaBuildingContext(), 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 PropertyFacadeTest method testSetPersistentClass.
@Test
public void testSetPersistentClass() throws Exception {
Field field = AbstractPropertyFacade.class.getDeclaredField("persistentClass");
field.setAccessible(true);
assertNull(field.get(propertyFacade));
assertNull(propertyTarget.getPersistentClass());
PersistentClass persistentClassTarget = new RootClass(DummyMetadataBuildingContext.INSTANCE);
IPersistentClass persistentClassFacade = FACADE_FACTORY.createPersistentClass(persistentClassTarget);
propertyFacade.setPersistentClass(persistentClassFacade);
assertSame(persistentClassFacade, field.get(propertyFacade));
assertSame(persistentClassTarget, propertyTarget.getPersistentClass());
}
use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class PropertyFacadeTest method testGetPersistentClass.
@Test
public void testGetPersistentClass() throws Exception {
Field field = AbstractPropertyFacade.class.getDeclaredField("persistentClass");
field.setAccessible(true);
assertNull(field.get(propertyFacade));
assertNull(propertyFacade.getPersistentClass());
PersistentClass persistentClassTarget = new RootClass(DummyMetadataBuildingContext.INSTANCE);
propertyTarget.setPersistentClass(persistentClassTarget);
IPersistentClass persistentClassFacade = propertyFacade.getPersistentClass();
assertNotNull(persistentClassFacade);
assertSame(persistentClassFacade, field.get(propertyFacade));
assertSame(persistentClassTarget, ((IFacade) persistentClassFacade).getTarget());
}
Aggregations