Java Code Examples for org.hibernate.persister.collection.CollectionPersister#isOneToMany()

The following examples show how to use org.hibernate.persister.collection.CollectionPersister#isOneToMany() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BatchingLoadQueryDetailsFactory.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Constructs a BasicCollectionLoadQueryDetails object from the given inputs.
 *
 * @param collectionPersister The collection persister.
 * @param loadPlan The load plan.
 * @param buildingParameters And influencers that would affect the generated SQL (mostly we are concerned with those
 * that add additional joins here)
 *
 * @return The EntityLoadQueryDetails
 */
public LoadQueryDetails makeCollectionLoadQueryDetails(
		CollectionPersister collectionPersister,
		LoadPlan loadPlan,
		QueryBuildingParameters buildingParameters) {
	final CollectionReturn rootReturn = RootHelper.INSTANCE.extractRootReturn( loadPlan, CollectionReturn.class );
	final AliasResolutionContextImpl aliasResolutionContext = new AliasResolutionContextImpl(
			collectionPersister.getFactory()
	);
	return collectionPersister.isOneToMany() ?
			new OneToManyLoadQueryDetails(
					loadPlan,
					aliasResolutionContext,
					rootReturn,
					buildingParameters,
					collectionPersister.getFactory()
			) :
			new BasicCollectionLoadQueryDetails(
					loadPlan,
					aliasResolutionContext,
					rootReturn,
					buildingParameters,
					collectionPersister.getFactory()
			);
}
 
Example 2
Source File: PersistentBag.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public boolean needsRecreate(CollectionPersister persister) {
	return !persister.isOneToMany();
}
 
Example 3
Source File: PersistentBag.java    From cacheonix-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public boolean needsRecreate(CollectionPersister persister) {
	return !persister.isOneToMany();
}