Search in sources :

Example 6 with NamingStrategy

use of org.hibernate.cfg.NamingStrategy in project jbosstools-hibernate by jbosstools.

the class FacadeFactoryTest method testCreateNamingStrategy.

@Test
public void testCreateNamingStrategy() {
    NamingStrategy namingStrategy = new DefaultNamingStrategy();
    INamingStrategy facade = facadeFactory.createNamingStrategy(namingStrategy);
    Assert.assertSame(namingStrategy, ((IFacade) facade).getTarget());
}
Also used : DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) NamingStrategy(org.hibernate.cfg.NamingStrategy) INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) Test(org.junit.Test)

Example 7 with NamingStrategy

use of org.hibernate.cfg.NamingStrategy in project jbosstools-hibernate by jbosstools.

the class FacadeFactoryTest method testCreateNamingStrategy.

@Test
public void testCreateNamingStrategy() {
    NamingStrategy namingStrategy = new DefaultNamingStrategy();
    INamingStrategy facade = facadeFactory.createNamingStrategy(namingStrategy);
    Assert.assertSame(namingStrategy, ((IFacade) facade).getTarget());
}
Also used : DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) NamingStrategy(org.hibernate.cfg.NamingStrategy) INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) Test(org.junit.Test)

Example 8 with NamingStrategy

use of org.hibernate.cfg.NamingStrategy in project jbosstools-hibernate by jbosstools.

the class ConfigurationFacadeTest method testSetNamingStrategy.

@Test
public void testSetNamingStrategy() {
    NamingStrategy dns = new DefaultNamingStrategy();
    INamingStrategy namingStrategy = FACADE_FACTORY.createNamingStrategy(dns);
    Assert.assertNotSame(dns, configuration.getNamingStrategy());
    configurationFacade.setNamingStrategy(namingStrategy);
    Assert.assertSame(dns, configuration.getNamingStrategy());
}
Also used : NamingStrategy(org.hibernate.cfg.NamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) Test(org.junit.Test)

Example 9 with NamingStrategy

use of org.hibernate.cfg.NamingStrategy in project jbosstools-hibernate by jbosstools.

the class ConfigurationFacadeTest method testGetNamingStrategy.

@Test
public void testGetNamingStrategy() {
    NamingStrategy firstStrategy = new DefaultNamingStrategy();
    configuration.setNamingStrategy(firstStrategy);
    INamingStrategy firstStrategyFacade = configurationFacade.getNamingStrategy();
    Assert.assertSame(firstStrategy, ((IFacade) firstStrategyFacade).getTarget());
    NamingStrategy secondStrategy = new DefaultNamingStrategy();
    configuration.setNamingStrategy(secondStrategy);
    INamingStrategy secondStrategyFacade = configurationFacade.getNamingStrategy();
    Assert.assertNotSame(secondStrategy, ((IFacade) secondStrategyFacade).getTarget());
}
Also used : NamingStrategy(org.hibernate.cfg.NamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) Test(org.junit.Test)

Example 10 with NamingStrategy

use of org.hibernate.cfg.NamingStrategy in project jbosstools-hibernate by jbosstools.

the class ConfigurationFacadeTest method testGetNamingStrategy.

@Test
public void testGetNamingStrategy() {
    NamingStrategy firstStrategy = new DefaultNamingStrategy();
    configuration.setNamingStrategy(firstStrategy);
    INamingStrategy firstStrategyFacade = configurationFacade.getNamingStrategy();
    Assert.assertSame(firstStrategy, ((IFacade) firstStrategyFacade).getTarget());
    NamingStrategy secondStrategy = new DefaultNamingStrategy();
    configuration.setNamingStrategy(secondStrategy);
    INamingStrategy secondStrategyFacade = configurationFacade.getNamingStrategy();
    Assert.assertNotSame(secondStrategy, ((IFacade) secondStrategyFacade).getTarget());
}
Also used : NamingStrategy(org.hibernate.cfg.NamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) INamingStrategy(org.jboss.tools.hibernate.runtime.spi.INamingStrategy) DefaultNamingStrategy(org.hibernate.cfg.DefaultNamingStrategy) Test(org.junit.Test)

Aggregations

NamingStrategy (org.hibernate.cfg.NamingStrategy)10 DefaultNamingStrategy (org.hibernate.cfg.DefaultNamingStrategy)9 INamingStrategy (org.jboss.tools.hibernate.runtime.spi.INamingStrategy)9 Test (org.junit.Test)9 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 Properties (java.util.Properties)1 HibernateException (org.hibernate.HibernateException)1 Configuration (org.hibernate.cfg.Configuration)1 StandardServiceRegistryImpl (org.hibernate.service.internal.StandardServiceRegistryImpl)1