Tabnine Logo
CollectionAliases
Code IndexAdd Tabnine to your IDE (free)

How to use
CollectionAliases
in
org.hibernate.loader

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

origin: hibernate/hibernate-orm

@Override
@SuppressWarnings("unchecked")
public Object readFrom(ResultSet rs, CollectionPersister persister, CollectionAliases descriptor, Object owner)
throws HibernateException, SQLException {
  final Object element = persister.readElement( rs, owner, descriptor.getSuffixedElementAliases(), getSession() );
  final int index = (Integer) persister.readIndex( rs, descriptor.getSuffixedIndexAliases(), getSession() );
  for ( int i = tempList.size(); i<=index; i++) {
    tempList.add( i, null );
  }
  tempList.set( index, element );
  return element;
}
origin: hibernate/hibernate-orm

printWriter.println(
    TreePrinterHelper.INSTANCE.generateNodePrefix( depth+3 )
        + "alias suffix - " + collectionReferenceAliases.getCollectionColumnAliases().getSuffix()
);
printWriter.println(
    TreePrinterHelper.INSTANCE.generateNodePrefix( depth+3 )
        + "suffixed key columns - "
        + String.join( ", ", collectionReferenceAliases.getCollectionColumnAliases().getSuffixedKeyAliases() )
);
final EntityReferenceAliases elementAliases = collectionReferenceAliases.getEntityElementAliases();
origin: hibernate/hibernate-orm

@Override
public Object readFrom(
    ResultSet rs,
    CollectionPersister persister,
    CollectionAliases descriptor,
    Object owner) throws HibernateException, SQLException {
  final Object element = persister.readElement( rs, owner, descriptor.getSuffixedElementAliases(), getSession() );
  final Object old = identifiers.put(
    values.size(),
    persister.readIdentifier( rs, descriptor.getSuffixedIdentifierAlias(), getSession() )
  );
  if ( old == null ) {
    //maintain correct duplication if loaded in a cartesian product
    values.add( element );
  }
  return element;
}
origin: hibernate/hibernate-orm

@Override
@SuppressWarnings("unchecked")
public Object readFrom(ResultSet rs, CollectionPersister persister, CollectionAliases descriptor, Object owner)
    throws HibernateException, SQLException {
  // note that if we load this collection from a cartesian product
  // the multiplicity would be broken ... so use an idbag instead
  final Object element = persister.readElement( rs, owner, descriptor.getSuffixedElementAliases(), getSession() ) ;
  if ( element != null ) {
    bag.add( element );
  }
  return element;
}
origin: hibernate/hibernate-ogm

private void preLoadBatchFetchingQueue(SharedSessionContractImplementor session, TupleAsMapResultSet resultset) {
  // Logic to eliminate the n+1 issue in collection loading when batch fetching is enabled.
  //
  // Walk the resultset to hydrate the collection elements.
  // Hydrating will add associated entities to the batch fetching queue without loading them.
  // The next resultset walking will effectively load these associated entities
  // but with the help of the properly loaded batch fetching queue.
  // Without this double phase, each element is individually loaded leading to n+1
  // because the batch fetching queue does not contain the "next" elements.
  try {
    while ( resultset.next() ) {
      // Call hydrate on the collection element itself
      // This is too much work as we are only interested in ToOne hydration
      // But ToOne can be contained in ComponentType
      // TODO: only call this hydration phase if we know that the collection contains directly or indirectly ToOnes
      Tuple tuple = resultset.unwrap( TupleAsMapResultSet.class ).getTuple();
      collectionPersisters[0].getElementGridType().hydrate( tuple, collectionAliases[0].getSuffixedElementAliases(), session, null );
      // a key might exist and might be an entity (not currently supported though in OGM)
      if ( collectionPersisters[0].getKeyColumnNames().length > 0 ) {
        collectionPersisters[0].getKeyGridType()
            .hydrate( tuple, collectionAliases[0].getSuffixedKeyAliases(), session, null );
      }
    }
    // reset resultset for main loop
    resultset.beforeFirst();
  }
  catch (SQLException e) {
    //never happens this is not a regular ResultSet
  }
}
origin: hibernate/hibernate-orm

    descriptor.getSuffixedKeyAliases(),
    session
);
origin: hibernate/hibernate-orm

@Override
protected void applyRootReturnSelectFragments(SelectStatementBuilder selectStatementBuilder) {
  selectStatementBuilder.appendSelectClauseFragment(
      getQueryableCollection().selectFragment(
          null,
          null,
          //getCollectionReferenceAliases().getCollectionTableAlias(),
          getElementEntityReferenceAliases().getTableAlias(),
          getElementEntityReferenceAliases().getColumnAliases().getSuffix(),
          getCollectionReferenceAliases().getCollectionColumnAliases().getSuffix(),
          true
      )
  );
  super.applyRootReturnSelectFragments( selectStatementBuilder );
}
origin: hibernate/hibernate-orm

@Override
@SuppressWarnings("unchecked")
public Object readFrom(
    ResultSet rs,
    CollectionPersister persister,
    CollectionAliases descriptor,
    Object owner) throws HibernateException, SQLException {
  final Object element = persister.readElement( rs, owner, descriptor.getSuffixedElementAliases(), getSession() );
  if ( element != null ) {
    tempList.add( element );
  }
  return element;
}
origin: hibernate/hibernate-orm

final Serializable collectionRowKey = (Serializable) collectionReference.getCollectionPersister().readKey(
    resultSet,
    aliases.getCollectionColumnAliases().getSuffixedKeyAliases(),
    context.getSession()
);
origin: hibernate/hibernate-orm

@Override
protected void applyRootReturnSelectFragments(SelectStatementBuilder selectStatementBuilder) {
  selectStatementBuilder.appendSelectClauseFragment(
    getQueryableCollection().selectFragment(
        getCollectionReferenceAliases().getCollectionTableAlias(),
        getCollectionReferenceAliases().getCollectionColumnAliases().getSuffix()
    )
  );
  if ( getQueryableCollection().isManyToMany() ) {
    final OuterJoinLoadable elementPersister = (OuterJoinLoadable) getQueryableCollection().getElementPersister();
    selectStatementBuilder.appendSelectClauseFragment(
        elementPersister.selectFragment(
            getCollectionReferenceAliases().getElementTableAlias(),
            getCollectionReferenceAliases().getEntityElementAliases().getColumnAliases().getSuffix()
        )
    );
  }
  super.applyRootReturnSelectFragments( selectStatementBuilder );
}
origin: hibernate/hibernate-orm

@Override
@SuppressWarnings("unchecked")
public Object readFrom(ResultSet rs, CollectionPersister persister, CollectionAliases descriptor, Object owner)
    throws HibernateException, SQLException {
  final Object element = persister.readElement( rs, owner, descriptor.getSuffixedElementAliases(), getSession() ) ;
  final int index = (Integer) persister.readIndex( rs, descriptor.getSuffixedIndexAliases(), getSession() );
  //pad with nulls from the current last element up to the new index
  for ( int i = list.size(); i<=index; i++) {
    list.add( i, null );
  }
  list.set( index, element );
  return element;
}
origin: org.hibernate/com.springsource.org.hibernate

public Object readFrom(
    ResultSet rs,
    CollectionPersister persister,
    CollectionAliases descriptor,
    Object owner) throws HibernateException, SQLException {
  Object element = persister.readElement( rs, owner, descriptor.getSuffixedElementAliases(), getSession() );
  if (element!=null) tempList.add(element);
  return element;
}
origin: hibernate/hibernate

public Object readFrom(
  ResultSet rs,
  CollectionPersister persister,
  CollectionAliases descriptor,
  Object owner)
  throws HibernateException, SQLException {
  Object element = persister.readElement( rs, owner, descriptor.getSuffixedElementAliases(), getSession() );
  Object old = identifiers.put(
    new Integer( values.size() ),
    persister.readIdentifier( rs, descriptor.getSuffixedIdentifierAlias(), getSession() )
  );
  if ( old==null ) values.add(element); //maintain correct duplication if loaded in a cartesian product
  return element;
}
origin: hibernate/hibernate

final Serializable collectionRowKey = (Serializable) persister.readKey( rs, descriptor.getSuffixedKeyAliases(), session );
origin: hibernate/hibernate-orm

printWriter.println(
    TreePrinterHelper.INSTANCE.generateNodePrefix( depth + detailDepthOffset )
        + "alias suffix - " + collectionReferenceAliases.getCollectionColumnAliases().getSuffix()
);
printWriter.println(
    TreePrinterHelper.INSTANCE.generateNodePrefix( depth + detailDepthOffset )
        + "suffixed key columns - {"
        + String.join( ", ", collectionReferenceAliases.getCollectionColumnAliases().getSuffixedKeyAliases() )
        + "}"
);
origin: hibernate/hibernate-orm

    aliases.getCollectionColumnAliases().getSuffix(),
    true
queryableCollection.selectFragment(
    aliases.getElementTableAlias(),
    aliases.getCollectionColumnAliases().getSuffix()
origin: hibernate/hibernate-orm

@Override
@SuppressWarnings("unchecked")
public Object readFrom(
    ResultSet rs,
    CollectionPersister persister,
    CollectionAliases descriptor,
    Object owner) throws HibernateException, SQLException {
  final Object element = persister.readElement( rs, owner, descriptor.getSuffixedElementAliases(), getSession() );
  if ( element != null ) {
    final Object index = persister.readIndex( rs, descriptor.getSuffixedIndexAliases(), getSession() );
    if ( loadingEntries == null ) {
      loadingEntries = new ArrayList<>();
    }
    loadingEntries.add( new Object[] { index, element } );
  }
  return element;
}
origin: hibernate/hibernate

public Object readFrom(
    ResultSet rs,
    CollectionPersister persister,
    CollectionAliases descriptor,
    Object owner) throws HibernateException, SQLException {
  Object element = persister.readElement( rs, owner, descriptor.getSuffixedElementAliases(), getSession() );
  if (element!=null) tempList.add(element);
  return element;
}
origin: org.hibernate/com.springsource.org.hibernate

public Object readFrom(
  ResultSet rs,
  CollectionPersister persister,
  CollectionAliases descriptor,
  Object owner)
  throws HibernateException, SQLException {
  Object element = persister.readElement( rs, owner, descriptor.getSuffixedElementAliases(), getSession() );
  Object old = identifiers.put(
    values.size(),
    persister.readIdentifier( rs, descriptor.getSuffixedIdentifierAlias(), getSession() )
  );
  if ( old==null ) values.add(element); //maintain correct duplication if loaded in a cartesian product
  return element;
}
origin: jboss.jboss-embeddable-ejb3/hibernate-all

  descriptor.getSuffixedKeyAliases(), 
  session 
);
org.hibernate.loaderCollectionAliases

Javadoc

Type definition of CollectionAliases.

Most used methods

  • getSuffixedElementAliases
    Returns the suffixed result-set column-aliases for the columns making up the collection's elements.
  • getSuffixedIndexAliases
    Returns the suffixed result-set column-aliases for the collumns making up the collection's index (ma
  • getSuffixedKeyAliases
    Returns the suffixed result-set column-aliases for columns making up the key for this collection (i.
  • getSuffixedIdentifierAlias
    Returns the suffixed result-set column-aliases for the column defining the collection's identifier (
  • getSuffix
    Returns the suffix used to unique the column aliases for this particular alias set.

Popular in Java

  • Running tasks concurrently on multiple threads
  • startActivity (Activity)
  • onRequestPermissionsResult (Fragment)
  • runOnUiThread (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • CodeWhisperer alternatives
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