Search in sources :

Example 26 with IFacade

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

the class ServiceImplTest method testNewDefaultConfiguration.

@Test
public void testNewDefaultConfiguration() {
    IConfiguration configuration = service.newDefaultConfiguration();
    Assert.assertNotNull(configuration);
    Object target = ((IFacade) configuration).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof Configuration);
}
Also used : Configuration(org.hibernate.cfg.Configuration) JDBCMetaDataConfiguration(org.hibernate.cfg.JDBCMetaDataConfiguration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Test(org.junit.Test)

Example 27 with IFacade

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

the class ServiceImplTest method testNewJDBCReader.

@Test
public void testNewJDBCReader() {
    IConfiguration configuration = service.newDefaultConfiguration();
    configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
    IReverseEngineeringStrategy strategy = service.newDefaultReverseEngineeringStrategy();
    IJDBCReader jdbcReader = service.newJDBCReader(configuration, strategy);
    Assert.assertNotNull(jdbcReader);
    Object target = ((IFacade) jdbcReader).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof JDBCReader);
}
Also used : IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) JDBCReader(org.hibernate.cfg.reveng.JDBCReader) Test(org.junit.Test)

Example 28 with IFacade

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

Example 29 with IFacade

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

the class ServiceImplTest method testNewProperty.

@Test
public void testNewProperty() {
    IProperty property = service.newProperty();
    Assert.assertNotNull(property);
    Object target = ((IFacade) property).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof Property);
}
Also used : IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Property(org.hibernate.mapping.Property) IProperty(org.jboss.tools.hibernate.runtime.spi.IProperty) Test(org.junit.Test)

Example 30 with IFacade

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

the class ServiceImplTest method testNewNamingStrategy.

@Test
public void testNewNamingStrategy() {
    String strategyClassName = DefaultNamingStrategy.class.getName();
    INamingStrategy namingStrategy = service.newNamingStrategy(strategyClassName);
    Assert.assertNotNull(namingStrategy);
    Object target = ((IFacade) namingStrategy).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof DefaultNamingStrategy);
}
Also used : INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) 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