org.hibernate.loader
abstract public class: BasicLoader [javadoc |
source]
java.lang.Object
org.hibernate.loader.Loader
org.hibernate.loader.BasicLoader
Direct Known Subclasses:
CriteriaLoader, OuterJoinLoader, AbstractEntityLoader, OneToManyLoader, CascadeEntityLoader, CollectionElementLoader, EntityLoader, SubselectOneToManyLoader, CollectionLoader, BasicCollectionLoader, QueryLoader, SubselectCollectionLoader, QueryTranslatorImpl, AbstractEntityLoader
Uses the default mapping from property to result set column
alias defined by the entities' persisters. Used when Hibernate
is generating result set column aliases.
| Field Summary |
|---|
| protected static final String[] | NO_SUFFIX | |
| Methods from org.hibernate.loader.Loader: |
|---|
|
applyLocks, autoDiscoverTypes, bindNamedParameters, bindParameterValues, bindPositionalParameters, checkScrollability, doList, getAliases, getCollectionAliases, getCollectionOwners, getCollectionPersisters, getEntityAliases, getEntityEagerPropertyFetches, getEntityPersisters, getFactory, getLockModes, getNamedParameterLocs, getOwnerAssociationTypes, getOwners, getQueryIdentifier, getResultColumnOrRow, getResultList, getResultSet, getSQLString, hasSubselectLoadableCollections, isSingleRowLoader, isSubselectLoadingEnabled, list, loadCollection, loadCollectionBatch, loadCollectionSubselect, loadEntity, loadEntity, loadEntityBatch, loadSequentialRowsForward, loadSequentialRowsReverse, loadSingleRow, needsFetchingScroll, postInstantiate, prepareQueryStatement, preprocessSQL, scroll, toString, upgradeLocks |
| Method from org.hibernate.loader.BasicLoader Detail: |
public static String[] generateSuffixes(int length) {
return generateSuffixes( 0, length );
}
Utility method that generates 0_, 1_ suffixes. Subclasses don't
necessarily need to use this algorithm, but it is intended that
they will in most cases. |
public static String[] generateSuffixes(int seed,
int length) {
if ( length == 0 ) return NO_SUFFIX;
String[] suffixes = new String[length];
for ( int i = 0; i < length; i++ ) {
suffixes[i] = Integer.toString( i + seed ) + "_";
}
return suffixes;
}
|
protected final CollectionAliases[] getCollectionAliases() {
return collectionDescriptors;
}
|
abstract protected String[] getCollectionSuffixes()
|
protected final EntityAliases[] getEntityAliases() {
return descriptors;
}
|
abstract protected String[] getSuffixes()
|
protected void postInstantiate() {
Loadable[] persisters = getEntityPersisters();
String[] suffixes = getSuffixes();
descriptors = new EntityAliases[persisters.length];
for ( int i=0; i< descriptors.length; i++ ) {
descriptors[i] = new DefaultEntityAliases( persisters[i], suffixes[i] );
}
CollectionPersister[] collectionPersisters = getCollectionPersisters();
int bagCount = 0;
if ( collectionPersisters != null ) {
String[] collectionSuffixes = getCollectionSuffixes();
collectionDescriptors = new CollectionAliases[collectionPersisters.length];
for ( int i = 0; i < collectionPersisters.length; i++ ) {
if ( isBag( collectionPersisters[i] ) ) {
bagCount++;
}
collectionDescriptors[i] = new GeneratedCollectionAliases(
collectionPersisters[i],
collectionSuffixes[i]
);
}
}
else {
collectionDescriptors = null;
}
if ( bagCount > 1 ) {
throw new HibernateException( "cannot simultaneously fetch multiple bags" );
}
}
|