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 testNewJoinedSubclass.
@Test
public void testNewJoinedSubclass() {
IPersistentClass persistentClass = service.newRootClass();
IPersistentClass joinedSubclass = service.newJoinedSubclass(persistentClass);
Assert.assertNotNull(joinedSubclass);
Object target = ((IFacade) joinedSubclass).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof JoinedSubclass);
Assert.assertSame(persistentClass, joinedSubclass.getSuperclass());
Assert.assertSame(((IFacade) persistentClass).getTarget(), ((JoinedSubclass) target).getSuperclass());
}
use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewList.
@Test
public void testNewList() {
IPersistentClass persistentClass = service.newRootClass();
IValue list = service.newList(persistentClass);
Assert.assertNotNull(list);
Object target = ((IFacade) list).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof org.hibernate.mapping.List);
}
use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewArray.
@Test
public void testNewArray() {
IPersistentClass persistentClass = service.newRootClass();
IValue array = service.newArray(persistentClass);
Assert.assertNotNull(array);
Object target = ((IFacade) array).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof Array);
}
use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass 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);
Assert.assertNotNull(specialRootClass);
Object target = ((IFacade) specialRootClass).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof RootClass);
Assert.assertSame(property, specialRootClass.getProperty());
}
Aggregations