Tabnine Logo
org.hibernate.loader
Code IndexAdd Tabnine to your IDE (free)

How to use org.hibernate.loader

Best Java code snippets using org.hibernate.loader (Showing top 20 results out of 315)

origin: hibernate/hibernate-orm

/**
 * For a collection role, return a list of associations to be fetched by outerjoin
 */
protected final void walkCollectionTree(QueryableCollection persister, String alias) throws MappingException {
  walkCollectionTree( persister, alias, new PropertyPath(), 0 );
  //TODO: when this is the entry point, we should use an INNER_JOIN for fetching the many-to-many elements!
}
origin: hibernate/hibernate-orm

protected final void initProjection(
    final String projectionString,
    final String whereString,
    final String orderByString,
    final String groupByString,
    final LockOptions lockOptions) throws MappingException {
  walkEntityTree( persister, getAlias() );
  persisters = new Loadable[0];
  initStatementString(projectionString, whereString, orderByString, groupByString, lockOptions);
}
origin: hibernate/hibernate-orm

/**
 * 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.
 *
 * @param length The number of suffixes to generate
 *
 * @return The array of generated suffixes (with length=length).
 */
public static String[] generateSuffixes(int length) {
  return generateSuffixes( 0, length );
}
origin: hibernate/hibernate-orm

protected void initFromWalker(JoinWalker walker) {
  persisters = walker.getPersisters();
  collectionPersisters = walker.getCollectionPersisters();
  ownerAssociationTypes = walker.getOwnerAssociationTypes();
  lockOptions = walker.getLockModeOptions();
  lockModeArray = walker.getLockModeArray();
  suffixes = walker.getSuffixes();
  collectionSuffixes = walker.getCollectionSuffixes();
  owners = walker.getOwners();
  collectionOwners = walker.getCollectionOwners();
  sql = walker.getSQLString();
  aliases = walker.getAliases();
}
origin: hibernate/hibernate-orm

public int getOwner(final List associations) {
  if ( isOneToOne() || isCollection() ) {
    return getPosition( lhsAlias, associations );
  }
  else {
    return -1;
  }
}
origin: hibernate/hibernate-orm

protected String orderBy(final List associations, final String orderBy) {
  return mergeOrderings( orderBy( associations ), orderBy );
}
origin: hibernate/hibernate-orm

public static OuterJoinableAssociation createRoot(
    AssociationType joinableType,
    String alias,
    SessionFactoryImplementor factory) {
  return new OuterJoinableAssociation(
      new PropertyPath(),
      joinableType,
      null,
      null,
      alias,
      JoinType.LEFT_OUTER_JOIN,
      null,
      false,
      factory,
      Collections.EMPTY_MAP
  );
}
origin: hibernate/hibernate-orm

/**
 * Walk the association tree for an entity, adding associations which should
 * be join fetched to the {@link #associations} inst var.  This form is the
 * entry point into the walking for a given entity, starting the recursive
 * calls into {@link #walkEntityTree(org.hibernate.persister.entity.OuterJoinLoadable, String, PropertyPath, int)}.
 *
 * @param persister The persister representing the entity to be walked.
 * @param alias The (root) alias to use for this entity/persister.
 *
 * @throws org.hibernate.MappingException ???
 */
protected final void walkEntityTree(
    OuterJoinLoadable persister,
    String alias) throws MappingException {
  walkEntityTree( persister, alias, new PropertyPath(), 0 );
}
origin: hibernate/hibernate-orm

/**
 * For entities, orderings added by, for example, Criteria#addOrder need to come before the associations' @OrderBy
 * values.  However, other sub-classes of JoinWalker (BasicCollectionJoinWalker, OneToManyJoinWalker, etc.)
 * still need the other way around.  So, override here instead.  See HHH-7116.
 */
@Override
protected String orderBy(final List associations, final String orderBy) {
  return mergeOrderings( orderBy, orderBy( associations ) );
}
origin: hibernate/hibernate-orm

private boolean isEagerPropertyFetchEnabled(int i) {
  boolean[] array = getEntityEagerPropertyFetches();
  return array != null && array[i];
}
origin: hibernate/hibernate-orm

private String[][] determinePropertyAliases(Loadable persister) {
  return getSuffixedPropertyAliases( persister );
}
origin: hibernate/hibernate-orm

/**
 * Execute an SQL query and attempt to instantiate instances of the class mapped by the given
 * persister from each row of the <tt>ResultSet</tt>. If an object is supplied, will attempt to
 * initialize that object. If a collection is supplied, attempt to initialize that collection.
 */
public List doQueryAndInitializeNonLazyCollections(
    final SharedSessionContractImplementor session,
    final QueryParameters queryParameters,
    final boolean returnProxies) throws HibernateException, SQLException {
  return doQueryAndInitializeNonLazyCollections(
      session,
      queryParameters,
      returnProxies,
      null
  );
}
origin: hibernate/hibernate-orm

protected boolean hasSubselectLoadableCollections() {
  final Loadable[] loadables = getEntityPersisters();
  for ( Loadable loadable : loadables ) {
    if ( loadable.hasSubselectLoadableCollections() ) {
      return true;
    }
  }
  return false;
}
origin: hibernate/hibernate-orm

public CollectionFetchableIndexAnyGraph(CollectionReference collectionReference) {
  super(
      // this property path is just informational...
      collectionReference.getPropertyPath().append( "<index>" )
  );
  this.collectionReference = collectionReference;
}
origin: hibernate/hibernate-orm

/**
 * The superclass deliberately excludes collections
 */
protected boolean isJoinedFetchEnabled(AssociationType type, FetchMode config, CascadeStyle cascadeStyle) {
  return isJoinedFetchEnabledInMapping( config, type );
}
origin: hibernate/hibernate-orm

public AbstractEntityJoinWalker(
    OuterJoinLoadable persister,
    SessionFactoryImplementor factory,
    LoadQueryInfluencers loadQueryInfluencers,
    String alias) {
  super( factory, loadQueryInfluencers );
  this.persister = persister;
  this.alias = ( alias == null ) ? generateRootAlias( persister.getEntityName() ) : alias;
}
origin: hibernate/hibernate-orm

private String extractFullPath(PropertyPath path) {
  return path == null ? "<no-path>" : path.getFullPath();
}
origin: hibernate/hibernate-orm

public PropertyPath append(String property) {
  return new PropertyPath( this, property );
}
origin: hibernate/hibernate-orm

private String generateEntitySuffix() {
  return BasicLoader.generateSuffixes( entitySuffixSeed++, 1 )[0];
}
origin: hibernate/hibernate-orm

public CollectionFetchableElementCompositeGraph(
    CollectionReference collectionReference,
    ExpandingCompositeQuerySpace compositeQuerySpace) {
  super(
      compositeQuerySpace,
      false,
      // these property paths are just informational...
      collectionReference.getPropertyPath().append( "<element>" )
  );
  this.collectionReference = collectionReference;
}
org.hibernate.loader

Most used classes

  • QueryLoader
    A delegate that implements the Loader part of QueryTranslator.
  • SubselectCollectionLoader
    Implements subselect fetching for a collection
  • SubselectOneToManyLoader
    Implements subselect fetching for a one to many association
  • CriteriaQueryTranslator
  • CriteriaJoinWalker
    A JoinWalker for Criteria queries.
  • CriteriaLoader,
  • CustomLoader,
  • CustomQuery,
  • EntityJoinWalker,
  • BasicLoader,
  • DefaultEntityAliases,
  • EntityAliases,
  • GeneratedCollectionAliases,
  • JoinWalker,
  • Loader,
  • OuterJoinLoader,
  • OuterJoinableAssociation,
  • CollectionInitializer,
  • CollectionLoader
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now