1 package org.hibernate.loader.entity; 3 4 import java.util.Collections ; 5 import java.util.Map ; 6 7 import org.hibernate.FetchMode; 8 import org.hibernate.LockMode; 9 import org.hibernate.MappingException; 10 import org.hibernate.engine.SessionFactoryImplementor; 11 import org.hibernate.loader.AbstractEntityJoinWalker; 12 import org.hibernate.persister.entity.OuterJoinLoadable; 13 import org.hibernate.type.AssociationType; 14 15 21 public class EntityJoinWalker extends AbstractEntityJoinWalker { 22 23 private final LockMode lockMode; 24 25 public EntityJoinWalker( 26 OuterJoinLoadable persister, 27 String [] uniqueKey, 28 int batchSize, 29 LockMode lockMode, 30 SessionFactoryImplementor factory, 31 Map enabledFilters) 32 throws MappingException { 33 super(persister, factory, enabledFilters); 34 35 this.lockMode = lockMode; 36 37 StringBuffer whereCondition = whereString( getAlias(), uniqueKey, batchSize ) 38 .append( persister.filterFragment( getAlias(), Collections.EMPTY_MAP ) ); 40 41 initAll( whereCondition.toString(), "", lockMode ); 42 43 } 44 45 49 protected boolean isJoinedFetchEnabled(AssociationType type, FetchMode config) { 50 return lockMode.greaterThan(LockMode.READ) ? 51 false : 52 super.isJoinedFetchEnabled(type, config); 53 } 54 55 public String getComment() { 56 return "load " + getPersister().getEntityName(); 57 } 58 59 } | Popular Tags |