FileDocCategorySizeDatePackage
NameGenerator.javaAPI DocHibernate 3.2.51186Mon Dec 06 07:17:24 GMT 2004org.hibernate.hql

NameGenerator

public final class NameGenerator extends Object
Provides utility methods for generating HQL / SQL names. Shared by both the 'classic' and 'new' query translators.
author
josh Mar 18, 2004 7:17:25 AM

Fields Summary
Constructors Summary
private NameGenerator()
Private empty constructor (checkstyle says utility classes should not have default constructors).

	
Methods Summary
public static java.lang.String[][]generateColumnNames(org.hibernate.type.Type[] types, org.hibernate.engine.SessionFactoryImplementor f)

		String[][] columnNames = new String[types.length][];
		for ( int i = 0; i < types.length; i++ ) {
			int span = types[i].getColumnSpan( f );
			columnNames[i] = new String[span];
			for ( int j = 0; j < span; j++ ) {
				columnNames[i][j] = NameGenerator.scalarName( i, j );
			}
		}
		return columnNames;
	
public static java.lang.StringscalarName(int x, int y)

		return new StringBuffer()
				.append( "col_" )
				.append( x )
				.append( '_" )
				.append( y )
				.append( '_" )
				.toString();