/** * Generate an empty join sequence instance. * * @return The generate join sequence. */ public JoinSequence createJoinSequence() { return new JoinSequence( sfi ); }
/** * Retrieve a JoinSequence that represents just the FROM clause parts * * @return The JoinSequence that represents just the FROM clause parts */ public JoinSequence getFromPart() { final JoinSequence fromPart = new JoinSequence( factory ); fromPart.joins.addAll( this.joins ); fromPart.useThetaStyle = this.useThetaStyle; fromPart.rootAlias = this.rootAlias; fromPart.rootJoinable = this.rootJoinable; fromPart.selector = this.selector; fromPart.next = this.next == null ? null : this.next.getFromPart(); fromPart.isFromPart = true; return fromPart; }
/** * Create a full, although shallow, copy. * * @return The copy */ public JoinSequence copy() { final JoinSequence copy = new JoinSequence( factory ); copy.joins.addAll( this.joins ); copy.useThetaStyle = this.useThetaStyle; copy.rootAlias = this.rootAlias; copy.rootJoinable = this.rootJoinable; copy.selector = this.selector; copy.next = this.next == null ? null : this.next.copy(); copy.isFromPart = this.isFromPart; copy.conditions.append( this.conditions.toString() ); return copy; }
public void start(QueryTranslatorImpl q) { if ( !continuation ) { reset( q ); path.setLength( 0 ); joinSequence = new JoinSequence( q.getFactory() ).setUseThetaStyle( useThetaStyleJoin ); } }
void addFromClass(String name, Queryable classPersister) throws QueryException { JoinSequence joinSequence = new JoinSequence( getFactory() ) .setRoot( classPersister, name ); //crossJoins.add(name); addFrom( name, classPersister.getEntityName(), joinSequence ); }
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 ); }
JoinSequence join = new JoinSequence( getFactory() ); collectionName = persister.isOneToMany() ? elementName :
/** * Generate an empty join sequence instance. * * @return The generate join sequence. */ public JoinSequence createJoinSequence() { return new JoinSequence( sfi ); }
/** * Generate an empty join sequence instance. * * @return The generate join sequence. */ public JoinSequence createJoinSequence() { return new JoinSequence( sfi ); }
public JoinSequence getFromPart() { JoinSequence fromPart = new JoinSequence( factory ); fromPart.joins.addAll( this.joins ); fromPart.useThetaStyle = this.useThetaStyle; fromPart.rootAlias = this.rootAlias; fromPart.rootJoinable = this.rootJoinable; fromPart.selector = this.selector; fromPart.next = this.next == null ? null : this.next.getFromPart(); fromPart.isFromPart = true; return fromPart; }
public JoinSequence copy() { JoinSequence copy = new JoinSequence( factory ); copy.joins.addAll( this.joins ); copy.useThetaStyle = this.useThetaStyle; copy.rootAlias = this.rootAlias; copy.rootJoinable = this.rootJoinable; copy.selector = this.selector; copy.next = this.next == null ? null : this.next.copy(); copy.isFromPart = this.isFromPart; copy.conditions.append( this.conditions.toString() ); return copy; }
public JoinSequence copy() { JoinSequence copy = new JoinSequence( factory ); copy.joins.addAll( this.joins ); copy.useThetaStyle = this.useThetaStyle; copy.rootAlias = this.rootAlias; copy.rootJoinable = this.rootJoinable; copy.selector = this.selector; copy.next = this.next == null ? null : this.next.copy(); copy.isFromPart = this.isFromPart; copy.conditions.append( this.conditions.toString() ); return copy; }
public JoinSequence getFromPart() { JoinSequence fromPart = new JoinSequence( factory ); fromPart.joins.addAll( this.joins ); fromPart.useThetaStyle = this.useThetaStyle; fromPart.rootAlias = this.rootAlias; fromPart.rootJoinable = this.rootJoinable; fromPart.selector = this.selector; fromPart.next = this.next == null ? null : this.next.getFromPart(); fromPart.isFromPart = true; return fromPart; }
public void start(QueryTranslatorImpl q) { if ( !continuation ) { reset( q ); path.setLength( 0 ); joinSequence = new JoinSequence( q.getFactory() ).setUseThetaStyle( useThetaStyleJoin ); } }
public void start(QueryTranslatorImpl q) { if ( !continuation ) { reset( q ); path.setLength( 0 ); joinSequence = new JoinSequence( q.getFactory() ).setUseThetaStyle( useThetaStyleJoin ); } }
void addFromClass(String name, Queryable classPersister) throws QueryException { JoinSequence joinSequence = new JoinSequence( getFactory() ) .setRoot( classPersister, name ); //crossJoins.add(name); addFrom( name, classPersister.getEntityName(), joinSequence ); }
void addFromClass(String name, Queryable classPersister) throws QueryException { JoinSequence joinSequence = new JoinSequence( getFactory() ) .setRoot( classPersister, name ); //crossJoins.add(name); addFrom( name, classPersister.getEntityName(), joinSequence ); }
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 ); }
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 ); }
JoinSequence join = new JoinSequence( getFactory() ); collectionName = persister.isOneToMany() ? elementName :