use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetAssociatedClass.
@Test
public void testSetAssociatedClass() {
RootClass rootClassTarget = new RootClass(null);
IPersistentClass rootClassFacade = FACADE_FACTORY.createPersistentClass(rootClassTarget);
OneToMany oneToManyTarget = new OneToMany(null, null);
valueFacade = FACADE_FACTORY.createValue(oneToManyTarget);
Assert.assertNull(oneToManyTarget.getAssociatedClass());
valueFacade.setAssociatedClass(rootClassFacade);
Assert.assertSame(rootClassTarget, oneToManyTarget.getAssociatedClass());
}
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(null);
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(null);
persistentClass.setEntityName("Foo");
IPersistentClass persistentClassFacade = FACADE_FACTORY.createPersistentClass(persistentClass);
Assert.assertNull(configurationFacade.getClassMapping("Foo"));
configurationFacade = FACADE_FACTORY.createConfiguration(configuration);
configurationFacade.addClass(persistentClassFacade);
Assert.assertEquals(persistentClassFacade, configurationFacade.getClassMapping("Foo"));
}
use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewSingleTableSubclass.
@Test
public void testNewSingleTableSubclass() {
IPersistentClass persistentClass = service.newRootClass();
IPersistentClass singleTableSublass = service.newSingleTableSubclass(persistentClass);
Assert.assertNotNull(singleTableSublass);
Object target = ((IFacade) singleTableSublass).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof SingleTableSubclass);
Assert.assertSame(persistentClass, singleTableSublass.getSuperclass());
Assert.assertSame(((IFacade) persistentClass).getTarget(), ((SingleTableSubclass) target).getSuperclass());
}
use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewRootClass.
@Test
public void testNewRootClass() {
IPersistentClass rootClass = service.newRootClass();
Assert.assertNotNull(rootClass);
Object target = ((IFacade) rootClass).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof RootClass);
}
Aggregations