下面列出了org.hibernate.persister.collection.CollectionPersister#isOneToMany ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* 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()
);
}
@Override
public boolean needsRecreate(CollectionPersister persister) {
return !persister.isOneToMany();
}
public boolean needsRecreate(CollectionPersister persister) {
return !persister.isOneToMany();
}