org.hibernate.type.AssociationType#isEntityType ( )源码实例Demo

下面列出了org.hibernate.type.AssociationType#isEntityType ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: lams   文件: JoinWalker.java
/**
 * Does the mapping, and Hibernate default semantics, specify that
 * this association should be fetched by outer joining
 */
protected boolean isJoinedFetchEnabledInMapping(FetchMode config, AssociationType type)
		throws MappingException {
	if ( !type.isEntityType() && !type.isCollectionType() ) {
		return false;
	}
	else {
		if ( config == FetchMode.JOIN ) {
			return true;
		}
		if ( config == FetchMode.SELECT ) {
			return false;
		}
		if ( type.isEntityType() ) {
			//TODO: look at the owning property and check that it 
			//      isn't lazy (by instrumentation)
			EntityType entityType = (EntityType) type;
			EntityPersister persister = getFactory().getEntityPersister( entityType.getAssociatedEntityName() );
			return !persister.hasProxy();
		}
		else {
			return false;
		}
	}
}
 
源代码2 项目: cacheonix-core   文件: JoinWalker.java
/**
 * Does the mapping, and Hibernate default semantics, specify that
 * this association should be fetched by outer joining
 */
protected boolean isJoinedFetchEnabledInMapping(FetchMode config, AssociationType type) 
throws MappingException {
	if ( !type.isEntityType() && !type.isCollectionType() ) {
		return false;
	}
	else {
		if (config==FetchMode.JOIN) return true;
		if (config==FetchMode.SELECT) return false;
		if ( type.isEntityType() ) {
			//TODO: look at the owning property and check that it 
			//      isn't lazy (by instrumentation)
			EntityType entityType =(EntityType) type;
			EntityPersister persister = getFactory().getEntityPersister( entityType.getAssociatedEntityName() );
			return !persister.hasProxy();
		}
		else {
			return false;
		}
	}
}
 
源代码3 项目: lams   文件: FetchStrategyHelper.java
private static boolean isSubsequentSelectDelayed(AssociationType type, SessionFactoryImplementor sessionFactory) {
	if ( type.isAnyType() ) {
		// we'd need more context here.  this is only kept as part of the property state on the owning entity
		return false;
	}
	else if ( type.isEntityType() ) {
		return ( (EntityPersister) type.getAssociatedJoinable( sessionFactory ) ).hasProxy();
	}
	else {
		final CollectionPersister cp = ( (CollectionPersister) type.getAssociatedJoinable( sessionFactory ) );
		return cp.isLazy() || cp.isExtraLazy();
	}
}
 
源代码4 项目: lams   文件: CascadeEntityJoinWalker.java
@Override
protected boolean isJoinedFetchEnabled(AssociationType type, FetchMode config, CascadeStyle cascadeStyle) {
	return ( type.isEntityType() || type.isCollectionType() ) &&
			( cascadeStyle == null || cascadeStyle.doCascade( cascadeAction ) );
}
 
源代码5 项目: cacheonix-core   文件: CascadeEntityJoinWalker.java
protected boolean isJoinedFetchEnabled(AssociationType type, FetchMode config, CascadeStyle cascadeStyle) {
	return ( type.isEntityType() || type.isCollectionType() ) &&
			( cascadeStyle==null || cascadeStyle.doCascade(cascadeAction) );
}
 
源代码6 项目: lams   文件: JoinWalker.java
/**
 * Override on subclasses to enable or suppress joining
 * of certain association types
 */
protected boolean isJoinedFetchEnabled(AssociationType type, FetchMode config, CascadeStyle cascadeStyle) {
	return type.isEntityType() && isJoinedFetchEnabledInMapping( config, type );
}
 
源代码7 项目: cacheonix-core   文件: JoinWalker.java
/**
 * Override on subclasses to enable or suppress joining 
 * of certain association types
 */
protected boolean isJoinedFetchEnabled(AssociationType type, FetchMode config, CascadeStyle cascadeStyle) {
	return type.isEntityType() && isJoinedFetchEnabledInMapping(config, type) ;
}