Methods Summary |
---|
public static java.lang.String[] | generateSuffixes(int 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.
return generateSuffixes( 0, length );
|
public static java.lang.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;
|
protected abstract java.lang.String[] | getCollectionSuffixes()
|
protected final EntityAliases[] | getEntityAliases()
return descriptors;
|
protected abstract java.lang.String[] | getSuffixes()
|
private boolean | isBag(org.hibernate.persister.collection.CollectionPersister collectionPersister)
return collectionPersister.getCollectionType().getClass().isAssignableFrom( BagType.class );
|
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" );
}
|