public Type getType() { //return memberPersister.getType(); return memberPersister.getCollectionType(); }
@Override public Type getType() { return queryableCollection.getCollectionType(); }
private void dereferenceCollection(String propertyName, String role, QueryTranslatorImpl q) throws QueryException { collectionRole = role; QueryableCollection collPersister = q.getCollectionPersister( role ); String name = q.createNameForCollection( role ); addJoin( name, collPersister.getCollectionType() ); //if ( collPersister.hasWhere() ) join.addCondition( collPersister.getSQLWhereString(name) ); collectionName = name; collectionOwnerName = currentName; currentName = name; currentProperty = propertyName; componentPath.setLength( 0 ); currentPropertyMapping = new CollectionPropertyMapping( collPersister ); }
public BasicCollectionJoinWalker( QueryableCollection collectionPersister, int batchSize, String subquery, SessionFactoryImplementor factory, LoadQueryInfluencers loadQueryInfluencers) throws MappingException { super( factory, loadQueryInfluencers ); this.collectionPersister = collectionPersister; String alias = generateRootAlias( collectionPersister.getRole() ); walkCollectionTree(collectionPersister, alias); List allAssociations = new ArrayList(); allAssociations.addAll(associations); allAssociations.add( OuterJoinableAssociation.createRoot( collectionPersister.getCollectionType(), alias, getFactory() ) ); initPersisters(allAssociations, LockMode.NONE); initStatementString(alias, batchSize, subquery); }
@Override protected void validateMapPropertyExpression(AST node) throws SemanticException { try { FromReferenceNode fromReferenceNode = (FromReferenceNode) node; QueryableCollection collectionPersister = fromReferenceNode.getFromElement().getQueryableCollection(); if ( !Map.class.isAssignableFrom( collectionPersister.getCollectionType().getReturnedClass() ) ) { throw new SemanticException( "node did not reference a map" ); } } catch (SemanticException se) { throw se; } catch (Throwable t) { throw new SemanticException( "node did not reference a map" ); } }
public OneToManyJoinWalker( QueryableCollection oneToManyPersister, int batchSize, String subquery, SessionFactoryImplementor factory, LoadQueryInfluencers loadQueryInfluencers) throws MappingException { super( factory, loadQueryInfluencers ); this.oneToManyPersister = oneToManyPersister; final OuterJoinLoadable elementPersister = (OuterJoinLoadable) oneToManyPersister.getElementPersister(); final String alias = generateRootAlias( oneToManyPersister.getRole() ); walkEntityTree( elementPersister, alias ); List allAssociations = new ArrayList(); allAssociations.addAll( associations ); allAssociations.add( OuterJoinableAssociation.createRoot( oneToManyPersister.getCollectionType(), alias, getFactory() ) ); initPersisters( allAssociations, LockMode.NONE ); initStatementString( elementPersister, alias, batchSize, subquery ); }
if ( isAliasRef( mapReference ) ) { final QueryableCollection collectionPersister = mapReference.getFromElement().getQueryableCollection(); if ( Map.class.isAssignableFrom( collectionPersister.getCollectionType().getReturnedClass() ) ) { sourceFromElement = mapReference.getFromElement();
private void prepareForIndex(QueryTranslatorImpl q) throws QueryException { QueryableCollection collPersister = q.getCollectionPersister( collectionRole ); if ( !collPersister.hasIndex() ) { throw new QueryException( "unindexed collection before []: " + path ); } String[] indexCols = collPersister.getIndexColumnNames(); if ( indexCols.length != 1 ) { throw new QueryException( "composite-index appears in []: " + path ); } //String[] keyCols = collPersister.getKeyColumnNames(); JoinSequence fromJoins = new JoinSequence( q.getFactory() ) .setUseThetaStyle( useThetaStyleJoin ) .setRoot( collPersister, collectionName ) .setNext( joinSequence.copy() ); if ( !continuation ) { addJoin( collectionName, collPersister.getCollectionType() ); } joinSequence.addCondition( collectionName + '.' + indexCols[0] + " = " ); //TODO: get SQL rendering out of here CollectionElement elem = new CollectionElement(); elem.elementColumns = collPersister.getElementColumnNames(collectionName); elem.elementType = collPersister.getElementType(); elem.isOneToMany = collPersister.isOneToMany(); elem.alias = collectionName; elem.joinSequence = joinSequence; collectionElements.addLast( elem ); setExpectingCollectionIndex(); q.addCollection( collectionName, collectionRole ); q.addFromJoinOnly( collectionName, fromJoins ); }
FromElement elem; this.queryableCollection = queryableCollection; collectionType = queryableCollection.getCollectionType(); String roleAlias = fromClause.getAliasGenerator().createName( role );
CollectionType type = queryableCollection.getCollectionType(); String role = type.getRole(); String roleAlias = origin.getTableAlias();
/** * {@inheritDoc} */ public Type getType() { return queryableCollection.getCollectionType(); }
public Type getType() { //return memberPersister.getType(); return memberPersister.getCollectionType(); }
public Type getType() { //return memberPersister.getType(); return memberPersister.getCollectionType(); }
public Type getType() { //return memberPersister.getType(); return memberPersister.getCollectionType(); }
/** * {@inheritDoc} */ public Type getType() { return queryableCollection.getCollectionType(); }
public Type getType() { //return memberPersister.getType(); return memberPersister.getCollectionType(); }
private void dereferenceCollection(String propertyName, String role, QueryTranslatorImpl q) throws QueryException { collectionRole = role; QueryableCollection collPersister = q.getCollectionPersister( role ); String name = q.createNameForCollection( role ); addJoin( name, collPersister.getCollectionType() ); //if ( collPersister.hasWhere() ) join.addCondition( collPersister.getSQLWhereString(name) ); collectionName = name; collectionOwnerName = currentName; currentName = name; currentProperty = propertyName; componentPath.setLength( 0 ); currentPropertyMapping = new CollectionPropertyMapping( collPersister ); }
private void dereferenceCollection(String propertyName, String role, QueryTranslatorImpl q) throws QueryException { collectionRole = role; QueryableCollection collPersister = q.getCollectionPersister( role ); String name = q.createNameForCollection( role ); addJoin( name, collPersister.getCollectionType() ); //if ( collPersister.hasWhere() ) join.addCondition( collPersister.getSQLWhereString(name) ); collectionName = name; collectionOwnerName = currentName; currentName = name; currentProperty = propertyName; componentPath.setLength( 0 ); currentPropertyMapping = new CollectionPropertyMapping( collPersister ); }
private void dereferenceCollection(String propertyName, String role, QueryTranslatorImpl q) throws QueryException { collectionRole = role; QueryableCollection collPersister = q.getCollectionPersister( role ); String name = q.createNameForCollection( role ); addJoin( name, collPersister.getCollectionType() ); //if ( collPersister.hasWhere() ) join.addCondition( collPersister.getSQLWhereString(name) ); collectionName = name; collectionOwnerName = currentName; currentName = name; currentProperty = propertyName; componentPath.setLength( 0 ); currentPropertyMapping = new CollectionPropertyMapping( collPersister ); }
private void dereferenceCollection(String propertyName, String role, QueryTranslatorImpl q) throws QueryException { collectionRole = role; QueryableCollection collPersister = q.getCollectionPersister( role ); String name = q.createNameForCollection( role ); addJoin( name, collPersister.getCollectionType() ); //if ( collPersister.hasWhere() ) join.addCondition( collPersister.getSQLWhereString(name) ); collectionName = name; collectionOwnerName = currentName; currentName = name; currentProperty = propertyName; componentPath.setLength( 0 ); currentPropertyMapping = new CollectionPropertyMapping( collPersister ); }