Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader
In directory sc8-pr-cvs1:/tmp/cvs-serv15497/sf/hibernate/loader
Modified Files:
Loader.java OuterJoinLoader.java
Log Message:
refactored alias generation into Alias class
Index: Loader.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/Loader.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Loader.java 4 Mar 2003 10:53:47 -0000 1.13
--- Loader.java 15 Mar 2003 04:38:17 -0000 1.14
***************
*** 26,29 ****
--- 26,30 ----
import net.sf.hibernate.util.StringHelper;
import net.sf.hibernate.persister.Loadable;
+ import net.sf.hibernate.sql.Alias;
import net.sf.hibernate.type.Type;
***************
*** 196,200 ****
if (id==null) {
//TODO: we can cache these on this object, from the constructor
! String[] keyColNames = StringHelper.suffix( persister.getIdentifierColumnNames(), suffix );
StringHelper.unQuoteInPlace(keyColNames);
--- 197,201 ----
if (id==null) {
//TODO: we can cache these on this object, from the constructor
! String[] keyColNames = new Alias(suffix).toAliasStrings( persister.getIdentifierColumnNames() );
StringHelper.unQuoteInPlace(keyColNames);
***************
*** 303,309 ****
if ( persister.hasSubclasses() ) {
! String col = StringHelper.unQuote(
! StringHelper.suffix( persister.getDiscriminatorColumnName(), suffix )
! );
// Code to handle subclasses of topClass
--- 304,308 ----
if ( persister.hasSubclasses() ) {
! String col = new Alias(suffix).toAliasString( persister.getDiscriminatorColumnName() );
// Code to handle subclasses of topClass
***************
*** 335,339 ****
for (int i=0; i<types.length; i++) {
//TODO: we can cache these on this object, from the constructor
! String[] cols = StringHelper.suffix( persister.getPropertyColumnNames(i), suffix );
StringHelper.unQuoteInPlace(cols);
--- 334,338 ----
for (int i=0; i<types.length; i++) {
//TODO: we can cache these on this object, from the constructor
! String[] cols = new Alias(suffix).toAliasStrings( persister.getPropertyColumnNames(i) );
StringHelper.unQuoteInPlace(cols);
Index: OuterJoinLoader.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/loader/OuterJoinLoader.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** OuterJoinLoader.java 23 Feb 2003 07:22:11 -0000 1.13
--- OuterJoinLoader.java 15 Mar 2003 04:38:17 -0000 1.14
***************
*** 15,18 ****
--- 15,19 ----
import net.sf.hibernate.persister.Loadable;
import net.sf.hibernate.persister.NormalizedEntityPersister;
+ import net.sf.hibernate.sql.Alias;
import net.sf.hibernate.sql.JoinFragment;
import net.sf.hibernate.type.AbstractComponentType;
***************
*** 232,239 ****
tableName = StringHelper.unqualify(tableName);
! return StringHelper.suffix(
! tableName.length() <=5 ? tableName : tableName.substring(0, 5),
! Integer.toString(n) + StringHelper.UNDERSCORE
! );
}
--- 233,238 ----
tableName = StringHelper.unqualify(tableName);
! return new Alias( 5, Integer.toString(n) + StringHelper.UNDERSCORE )
! .toAliasString(tableName);
}
|