Hibernate ORM EJB3NamingStrategy - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM EJB3NamingStrategy class.

This code example shows how to use the following methods:
//$Id$ 
package org.hibernate.ejb.test; 
import org.hibernate.cfg.EJB3NamingStrategy; 
 
/** 
 * @author Emmanuel Bernard 
 */ 
public class MyNamingStrategy extends EJB3NamingStrategy { 
	@Override 
	public String tableName(String tableName) { 
		return "tbl_" + super.tableName( tableName ); 
	} 
} 

5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
// $Id$ 
package org.hibernate.test.annotations.namingstrategy; 
 
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Iterator;
 
import org.jboss.logging.Logger; 
 
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.EJB3NamingStrategy;
import org.hibernate.cfg.Environment;
import org.hibernate.cfg.Mappings;
import org.hibernate.mapping.Table;
import org.hibernate.service.ServiceRegistry;
 
import junit.framework.TestCase;
 
import org.hibernate.testing.ServiceRegistryBuilder; 
 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
//$Id$ 
package org.hibernate.test.annotations; 
import org.hibernate.cfg.EJB3NamingStrategy;
import org.hibernate.cfg.NamingStrategy;
import org.hibernate.internal.util.StringHelper;
 
/** 
 * @author Emmanuel Bernard 
 */ 
public class AlternativeNamingStrategy extends EJB3NamingStrategy {
	public static NamingStrategy INSTANCE = new AlternativeNamingStrategy();
 
	public String classToTableName(String className) {
		return tableName( StringHelper.unqualify( className ) );
	} 
 
	public String propertyToColumnName(String propertyName) {
		return columnName( StringHelper.unqualify( propertyName ) );
	} 
 

5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
// $Id$ 
package org.hibernate.test.annotations.namingstrategy; 
import org.hibernate.cfg.EJB3NamingStrategy; 
 
@SuppressWarnings("serial") 
public class DummyNamingStrategy extends EJB3NamingStrategy { 
	 
	public String tableName(String tableName) { 
		return "T" + tableName; 
	} 
 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
import org.hibernate.cfg.EJB3NamingStrategy;
 
/** 
 * @author lazyman 
 */ 
public class MidPointNamingStrategy extends EJB3NamingStrategy {
 
    private static final Trace LOGGER = TraceManager.getTrace(MidPointNamingStrategy.class);
    private static final int MAX_LENGTH = 30;
 
    @Override 
    public String classToTableName(String className) {
        String name = className.substring(1);
        //change camel case to underscore delimited 
        name = name.replaceAll(String.format("%s|%s|%s",
                "(?<=[A-Z])(?=[A-Z][a-z])", 
                "(?<=[^A-Z])(?=[A-Z])", 
                "(?<=[A-Za-z])(?=[^A-Za-z])" 
        ), "_"); 
 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
 *  - based of the JPA 2 naming strategy 
 *  - column names in components defaults to the fully qualified path (ie address.city) 
 * 
 * @author Emmanuel Bernard 
 */ 
public class OgmNamingStrategy extends EJB3NamingStrategy {
 
	public static final NamingStrategy INSTANCE = new OgmNamingStrategy();
 
	/** 
	 * A pattern common to all property names used in element collections. 
	 */ 
	private static final String ELEMENT_COLLECTION_NAME_PATTERN = "collection&&element";
 
 
	// noop method kept for documentation purposes 
	private String replacePropertySeparator(String name) {
		//the . is already present, no need to replace it 
		// Other strategies would typically replace '.' with '_' 
		return name;
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
See Code Examples for Hibernate ORM EJB3NamingStrategy Methods: