org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl Java Examples

The following examples show how to use org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestDal.java    From Insights with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) {
	/*Configuration configuration = new Configuration();
	configuration.configure("hibernate.cfg.xml");
	configuration.setProperty("hibernate.connection.username","grafana123");
	ServiceRegistry standardRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).configure().build();*/
	ServiceRegistry standardRegistry = new StandardServiceRegistryBuilder().configure().build();
	MetadataSources sources = new MetadataSources( standardRegistry );
	sources.addAnnotatedClass( Test.class );
	Metadata metadata = sources.getMetadataBuilder().applyImplicitNamingStrategy(ImplicitNamingStrategyJpaCompliantImpl.INSTANCE).build();
	SessionFactory sessionFactory = metadata.buildSessionFactory();
	Session session = sessionFactory.openSession();
	session.beginTransaction();
	Test s = new Test();
	s.setName("12Vishal123");
	session.save(s);
	session.getTransaction().commit();
	session.close();
	sessionFactory.close();
}
 
Example #2
Source File: DatabaseManager.java    From cwlexec with Apache License 2.0 5 votes vote down vote up
private Metadata init(Properties dbConfig) {
    StandardServiceRegistry registry = new StandardServiceRegistryBuilder()
            .applySettings(dbConfig)
            .build();
    return new MetadataSources(registry)
            .addAnnotatedClass(CWLMainProcessRecord.class)
            .addAnnotatedClass(CWLStepProcessRecord.class)
            .getMetadataBuilder()
            .applyImplicitNamingStrategy(ImplicitNamingStrategyJpaCompliantImpl.INSTANCE)
            .build();
}
 
Example #3
Source File: QuarkusStrategySelectorBuilder.java    From quarkus with Apache License 2.0 5 votes vote down vote up
private static void addImplicitNamingStrategies(StrategySelectorImpl strategySelector) {
    strategySelector.registerStrategyImplementor(
            ImplicitNamingStrategy.class,
            "default",
            ImplicitNamingStrategyJpaCompliantImpl.class);
    strategySelector.registerStrategyImplementor(
            ImplicitNamingStrategy.class,
            "jpa",
            ImplicitNamingStrategyJpaCompliantImpl.class);
    strategySelector.registerStrategyImplementor(
            ImplicitNamingStrategy.class,
            "component-path",
            ImplicitNamingStrategyComponentPathImpl.class);
}
 
Example #4
Source File: Configuration.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
protected void reset() {
	implicitNamingStrategy = ImplicitNamingStrategyJpaCompliantImpl.INSTANCE;
	physicalNamingStrategy = PhysicalNamingStrategyStandardImpl.INSTANCE;
	namedQueries = new HashMap<String,NamedQueryDefinition>();
	namedSqlQueries = new HashMap<String,NamedSQLQueryDefinition>();
	sqlResultSetMappings = new HashMap<String, ResultSetMappingDefinition>();
	namedEntityGraphMap = new HashMap<String, NamedEntityGraphDefinition>();
	namedProcedureCallMap = new HashMap<String, NamedProcedureCallDefinition>(  );

	standardServiceRegistryBuilder = new StandardServiceRegistryBuilder( bootstrapServiceRegistry );
	entityTuplizerFactory = new EntityTuplizerFactory();
	interceptor = EmptyInterceptor.INSTANCE;
	properties = new Properties(  );
	properties.putAll( standardServiceRegistryBuilder.getSettings());
}
 
Example #5
Source File: StrategySelectorBuilder.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
private void addImplicitNamingStrategies(StrategySelectorImpl strategySelector) {
	strategySelector.registerStrategyImplementor(
			ImplicitNamingStrategy.class,
			"default",
			ImplicitNamingStrategyJpaCompliantImpl.class
	);
	strategySelector.registerStrategyImplementor(
			ImplicitNamingStrategy.class,
			"jpa",
			ImplicitNamingStrategyJpaCompliantImpl.class
	);
	strategySelector.registerStrategyImplementor(
			ImplicitNamingStrategy.class,
			"legacy-jpa",
			ImplicitNamingStrategyLegacyJpaImpl.class
	);
	strategySelector.registerStrategyImplementor(
			ImplicitNamingStrategy.class,
			"legacy-hbm",
			ImplicitNamingStrategyLegacyHbmImpl.class
	);
	strategySelector.registerStrategyImplementor(
			ImplicitNamingStrategy.class,
			"component-path",
			ImplicitNamingStrategyComponentPathImpl.class
	);
}