Search in sources :

Example 31 with ReverseEngineeringStrategy

use of org.hibernate.cfg.reveng.ReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.

the class ConfigurationFacadeTest method testSetReverseEngineeringStrategy.

@Test
public void testSetReverseEngineeringStrategy() {
    JDBCMetaDataConfiguration configuration = new JDBCMetaDataConfiguration();
    configurationFacade = FACADE_FACTORY.createConfiguration(configuration);
    ReverseEngineeringStrategy reverseEngineeringStrategy = new DefaultReverseEngineeringStrategy();
    IReverseEngineeringStrategy strategyFacade = FACADE_FACTORY.createReverseEngineeringStrategy(reverseEngineeringStrategy);
    Assert.assertNotSame(reverseEngineeringStrategy, configuration.getReverseEngineeringStrategy());
    configurationFacade.setReverseEngineeringStrategy(strategyFacade);
    Assert.assertSame(reverseEngineeringStrategy, configuration.getReverseEngineeringStrategy());
}
Also used : JDBCMetaDataConfiguration(org.hibernate.cfg.JDBCMetaDataConfiguration) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) ReverseEngineeringStrategy(org.hibernate.cfg.reveng.ReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) Test(org.junit.Test)

Example 32 with ReverseEngineeringStrategy

use of org.hibernate.cfg.reveng.ReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.

the class FacadeFactoryTest method testCreateReverseEngineeringStrategy.

@Test
public void testCreateReverseEngineeringStrategy() {
    ReverseEngineeringStrategy res = (ReverseEngineeringStrategy) Proxy.newProxyInstance(facadeFactory.getClassLoader(), new Class[] { ReverseEngineeringStrategy.class }, new TestInvocationHandler());
    IReverseEngineeringStrategy facade = facadeFactory.createReverseEngineeringStrategy(res);
    Assert.assertSame(res, ((IFacade) facade).getTarget());
}
Also used : IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) ReverseEngineeringStrategy(org.hibernate.cfg.reveng.ReverseEngineeringStrategy) PersistentClass(org.hibernate.mapping.PersistentClass) IPOJOClass(org.jboss.tools.hibernate.runtime.spi.IPOJOClass) RootClass(org.hibernate.mapping.RootClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) POJOClass(org.hibernate.tool.hbm2x.pojo.POJOClass) Test(org.junit.Test)

Example 33 with ReverseEngineeringStrategy

use of org.hibernate.cfg.reveng.ReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewDefaultReverseEngineeringStrategy.

@Test
public void testNewDefaultReverseEngineeringStrategy() throws Exception {
    IReverseEngineeringStrategy reverseEngineeringStrategy = service.newDefaultReverseEngineeringStrategy();
    Assert.assertNotNull(reverseEngineeringStrategy);
    Object target = ((IFacade) reverseEngineeringStrategy).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof ReverseEngineeringStrategy);
}
Also used : IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DelegatingReverseEngineeringStrategy(org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) ReverseEngineeringStrategy(org.hibernate.cfg.reveng.ReverseEngineeringStrategy) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) Test(org.junit.Test)

Example 34 with ReverseEngineeringStrategy

use of org.hibernate.cfg.reveng.ReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.

the class ConfigurationFacadeTest method testSetReverseEngineeringStrategy.

@Test
public void testSetReverseEngineeringStrategy() {
    JdbcMetadataConfiguration configuration = new JdbcMetadataConfiguration();
    configurationFacade = FACADE_FACTORY.createConfiguration(configuration);
    ReverseEngineeringStrategy reverseEngineeringStrategy = new DefaultReverseEngineeringStrategy();
    IReverseEngineeringStrategy strategyFacade = FACADE_FACTORY.createReverseEngineeringStrategy(reverseEngineeringStrategy);
    Assert.assertNotSame(reverseEngineeringStrategy, configuration.getReverseEngineeringStrategy());
    configurationFacade.setReverseEngineeringStrategy(strategyFacade);
    Assert.assertSame(reverseEngineeringStrategy, configuration.getReverseEngineeringStrategy());
}
Also used : IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) JdbcMetadataConfiguration(org.jboss.tools.hibernate.runtime.v_5_3.internal.util.JdbcMetadataConfiguration) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) ReverseEngineeringStrategy(org.hibernate.cfg.reveng.ReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) Test(org.junit.Test)

Example 35 with ReverseEngineeringStrategy

use of org.hibernate.cfg.reveng.ReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.

the class ConfigurationFacadeTest method testSetReverseEngineeringStrategy.

@Test
public void testSetReverseEngineeringStrategy() {
    JDBCMetaDataConfiguration configuration = new JDBCMetaDataConfiguration();
    configurationFacade = FACADE_FACTORY.createConfiguration(configuration);
    ReverseEngineeringStrategy reverseEngineeringStrategy = new DefaultReverseEngineeringStrategy();
    IReverseEngineeringStrategy strategyFacade = FACADE_FACTORY.createReverseEngineeringStrategy(reverseEngineeringStrategy);
    Assert.assertNotSame(reverseEngineeringStrategy, configuration.getReverseEngineeringStrategy());
    configurationFacade.setReverseEngineeringStrategy(strategyFacade);
    Assert.assertSame(reverseEngineeringStrategy, configuration.getReverseEngineeringStrategy());
}
Also used : JDBCMetaDataConfiguration(org.hibernate.cfg.JDBCMetaDataConfiguration) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) ReverseEngineeringStrategy(org.hibernate.cfg.reveng.ReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) Test(org.junit.Test)

Aggregations

DefaultReverseEngineeringStrategy (org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy)36 ReverseEngineeringStrategy (org.hibernate.cfg.reveng.ReverseEngineeringStrategy)36 IReverseEngineeringStrategy (org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy)36 Test (org.junit.Test)28 DelegatingReverseEngineeringStrategy (org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy)12 PersistentClass (org.hibernate.mapping.PersistentClass)12 RootClass (org.hibernate.mapping.RootClass)12 IPersistentClass (org.jboss.tools.hibernate.runtime.spi.IPersistentClass)12 Field (java.lang.reflect.Field)8 POJOClass (org.hibernate.tool.hbm2x.pojo.POJOClass)8 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)8 IPOJOClass (org.jboss.tools.hibernate.runtime.spi.IPOJOClass)8 JDBCMetaDataConfiguration (org.hibernate.cfg.JDBCMetaDataConfiguration)7 HibernateConsoleRuntimeException (org.hibernate.console.HibernateConsoleRuntimeException)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 SQLException (java.sql.SQLException)1 HibernateException (org.jboss.tools.hibernate.runtime.spi.HibernateException)1 JdbcMetadataConfiguration (org.jboss.tools.hibernate.runtime.v_5_3.internal.util.JdbcMetadataConfiguration)1