AnnotationConfiguration setNamingStrategy - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for AnnotationConfiguration setNamingStrategy method.

This code example shows how to use the following methods:addAnnotatedClass, setNamingStrategy, buildSessionFactory
        if (serviceRegistry != null) ServiceRegistryBuilder.destroy(serviceRegistry);
	} 
 
	public void testWithCustomNamingStrategy() throws Exception {
		try { 
			AnnotationConfiguration config = new AnnotationConfiguration();
			config.setNamingStrategy(new DummyNamingStrategy());
			config.addAnnotatedClass(Address.class);
			config.addAnnotatedClass(Person.class);
			config.buildSessionFactory( serviceRegistry );
		} 
		catch( Exception e ) {
			StringWriter writer = new StringWriter();
			e.printStackTrace(new PrintWriter(writer));
            log.debug(writer.toString());
			fail(e.getMessage());
		} 
	} 
 
	public void testWithEJB3NamingStrategy() throws Exception {
6
CodeRank
setNamingStrategy Method Overview
Set the current naming strategy.
See Code Examples for other Hibernate ORM AnnotationConfiguration Methods: