use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class HbmExporterTest method testId.
public void testId() {
// $NON-NLS-1$
IConfiguration config = getConfigurationFor("pack.A");
// $NON-NLS-1$ //$NON-NLS-2$
checkClassesMaped(config, "pack.A", "pack.B");
// $NON-NLS-1$
IPersistentClass a = config.getClassMapping("pack.A");
// $NON-NLS-1$
IPersistentClass b = config.getClassMapping("pack.B");
IProperty aId = a.getIdentifierProperty();
IProperty bId = b.getIdentifierProperty();
assertNotNull(aId);
assertNotNull(bId);
// $NON-NLS-1$
assertEquals("id", aId.getName());
// $NON-NLS-1$
assertEquals("id", bId.getName());
}
use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateSpecialRootClass.
@Test
public void testCreateSpecialRootClass() {
Property property = new Property();
property.setValue(new SimpleValue());
IProperty propertyFacade = new AbstractPropertyFacade(facadeFactory, property) {
};
IPersistentClass specialRootClass = facadeFactory.createSpecialRootClass(propertyFacade);
Assert.assertSame(property, ((IFacade) specialRootClass.getProperty()).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreatePersistentClass.
@Test
public void testCreatePersistentClass() {
PersistentClass persistentClass = new RootClass();
IPersistentClass facade = facadeFactory.createPersistentClass(persistentClass);
Assert.assertSame(persistentClass, ((IFacade) facade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class Cfg2HbmToolFacadeTest method testGetPersistentClassTag.
@Test
public void testGetPersistentClassTag() {
PersistentClass target = new RootClass();
IPersistentClass persistentClass = new AbstractPersistentClassFacade(FACADE_FACTORY, target) {
};
Assert.assertEquals("class", cfg2HbmToolFacade.getTag(persistentClass));
}
use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class ConfigurationFacadeTest method testAddClass.
@Test
public void testAddClass() {
PersistentClass persistentClass = new RootClass();
persistentClass.setEntityName("Foo");
IPersistentClass persistentClassFacade = FACADE_FACTORY.createPersistentClass(persistentClass);
Assert.assertNull(configuration.getClassMapping("Foo"));
configurationFacade.addClass(persistentClassFacade);
Assert.assertEquals(persistentClass, configuration.getClassMapping("Foo"));
}
Aggregations