Search in sources :

Example 36 with IFacade

use of org.jboss.tools.hibernate.runtime.common.IFacade in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewPrimitiveArray.

@Test
public void testNewPrimitiveArray() {
    IPersistentClass persistentClass = service.newRootClass();
    IValue primitiveArray = service.newPrimitiveArray(persistentClass);
    Assert.assertNotNull(primitiveArray);
    Object target = ((IFacade) primitiveArray).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof PrimitiveArray);
}
Also used : IValue(org.jboss.tools.hibernate.runtime.spi.IValue) PrimitiveArray(org.hibernate.mapping.PrimitiveArray) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) Test(org.junit.Test)

Example 37 with IFacade

use of org.jboss.tools.hibernate.runtime.common.IFacade 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);
}
Also used : RootClass(org.hibernate.mapping.RootClass) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) Test(org.junit.Test)

Example 38 with IFacade

use of org.jboss.tools.hibernate.runtime.common.IFacade 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());
}
Also used : IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) SingleTableSubclass(org.hibernate.mapping.SingleTableSubclass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) Test(org.junit.Test)

Example 39 with IFacade

use of org.jboss.tools.hibernate.runtime.common.IFacade 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());
}
Also used : RootClass(org.hibernate.mapping.RootClass) IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) Test(org.junit.Test)

Example 40 with IFacade

use of org.jboss.tools.hibernate.runtime.common.IFacade in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testSimpleValue.

@Test
public void testSimpleValue() {
    IValue simpleValue = service.newSimpleValue();
    Assert.assertNotNull(simpleValue);
    Object target = ((IFacade) simpleValue).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof SimpleValue);
}
Also used : IValue(org.jboss.tools.hibernate.runtime.spi.IValue) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) SimpleValue(org.hibernate.mapping.SimpleValue) Test(org.junit.Test)

Aggregations

IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)188 Test (org.junit.Test)156 IPersistentClass (org.jboss.tools.hibernate.runtime.spi.IPersistentClass)60 IValue (org.jboss.tools.hibernate.runtime.spi.IValue)40 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)29 Configuration (org.hibernate.cfg.Configuration)20 IReverseEngineeringStrategy (org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy)20 RootClass (org.hibernate.mapping.RootClass)19 Table (org.hibernate.mapping.Table)15 JDBCMetaDataConfiguration (org.hibernate.cfg.JDBCMetaDataConfiguration)13 File (java.io.File)12 PersistentClass (org.hibernate.mapping.PersistentClass)12 IProperty (org.jboss.tools.hibernate.runtime.spi.IProperty)12 ISessionFactory (org.jboss.tools.hibernate.runtime.spi.ISessionFactory)12 ITable (org.jboss.tools.hibernate.runtime.spi.ITable)11 Field (java.lang.reflect.Field)9 JDBCReader (org.hibernate.cfg.reveng.JDBCReader)9 IJDBCReader (org.jboss.tools.hibernate.runtime.spi.IJDBCReader)9 HashMap (java.util.HashMap)8 Map (java.util.Map)8