private void renderScalarSelects(SelectExpression[] se, FromClause currentFromClause) throws SemanticException { if ( !currentFromClause.isSubQuery() ) { for ( int i = 0; i < se.length; i++ ) { SelectExpression expr = se[i]; expr.setScalarColumn( i ); // Create SQL_TOKEN nodes for the columns. } } }
public boolean isAlias(String alias) { FromClause from = walker.getCurrentFromClause(); while ( from.isSubQuery() ) { if ( from.containsClassAlias( alias ) ) { return true; } from = from.getParentFromClause(); } return from.containsClassAlias( alias ); }
checkInitialized(); if ( fromElement.getFromClause().isSubQuery() ) {
SelectExpression expr, ASTAppender appender) { if ( !fromElement.getFromClause().isSubQuery() ) { if ( !scalarSelect && !getWalker().isShallowQuery() ) {
public boolean includeSubclasses(String alias) { // The uber-rule here is that we need to include subclass joins if // the FromElement is in any way dereferenced by a property from // the subclass table; otherwise we end up with column references // qualified by a non-existent table reference in the resulting SQL... boolean containsTableAlias = fromClause.containsTableAlias( alias ); if ( fromElement.isDereferencedBySubclassProperty() ) { // TODO : or should we return 'containsTableAlias'?? LOG.tracev( "Forcing inclusion of extra joins [alias={0}, containsTableAlias={1}]", alias, containsTableAlias ); return true; } boolean shallowQuery = walker.isShallowQuery(); boolean includeSubclasses = fromElement.isIncludeSubclasses(); boolean subQuery = fromClause.isSubQuery(); return includeSubclasses && containsTableAlias && !subQuery && !shallowQuery; } }
if ( !currentFromClause.isSubQuery() ) {
( fromElement.getFromClause().isSubQuery()
boolean explicitSubqueryFromElement = fromClause.isSubQuery() && !implied; if ( explicitSubqueryFromElement ) { String pathRoot = StringHelper.root( path );
if ( getWalker().isShallowQuery() || getWalker().getCurrentFromClause().isSubQuery() ) { resolve( false, true );
private void renderScalarSelects(SelectExpression[] se, FromClause currentFromClause) throws SemanticException { if ( !currentFromClause.isSubQuery() ) { for ( int i = 0; i < se.length; i++ ) { SelectExpression expr = se[i]; expr.setScalarColumn( i ); // Create SQL_TOKEN nodes for the columns. } } }
private void renderScalarSelects(SelectExpression[] se, FromClause currentFromClause) throws SemanticException { if ( !currentFromClause.isSubQuery() ) { for ( int i = 0; i < se.length; i++ ) { SelectExpression expr = se[i]; expr.setScalarColumn( i ); // Create SQL_TOKEN nodes for the columns. } } }
public boolean isAlias(String alias) { FromClause from = walker.getCurrentFromClause(); while ( from.isSubQuery() ) { if ( from.containsClassAlias(alias) ) { return true; } from = from.getParentFromClause(); } return from.containsClassAlias(alias); }
public boolean isAlias(String alias) { FromClause from = walker.getCurrentFromClause(); while ( from.isSubQuery() ) { if ( from.containsClassAlias(alias) ) { return true; } from = from.getParentFromClause(); } return from.containsClassAlias(alias); }
/** * Returns the identifier select SQL fragment. * * @param size The total number of returned types. * @param k The sequence of the current returned type. * @return the identifier select SQL fragment. */ String renderIdentifierSelect(int size, int k) { checkInitialized(); // Render the identifier select fragment using the table alias. if ( fromElement.getFromClause().isSubQuery() ) { // TODO: Replace this with a more elegant solution. String[] idColumnNames = ( persister != null ) ? ( ( Queryable ) persister ).getIdentifierColumnNames() : new String[0]; StringBuffer buf = new StringBuffer(); for ( int i = 0; i < idColumnNames.length; i++ ) { buf.append( fromElement.getTableAlias() ).append( '.' ).append( idColumnNames[i] ); if ( i != idColumnNames.length - 1 ) buf.append( ", " ); } return buf.toString(); } else { if (persister==null) { throw new QueryException( "not an entity" ); } String fragment = ( ( Queryable ) persister ).identifierSelectFragment( getTableAlias(), getSuffix( size, k ) ); return trimLeadingCommaAndSpaces( fragment ); } }
private void renderNonScalarIdentifiers(FromElement fromElement, int nonscalarSize, int j, SelectExpression expr, ASTAppender appender) { String text = fromElement.renderIdentifierSelect( nonscalarSize, j ); if ( !fromElement.getFromClause().isSubQuery() ) { if ( !scalarSelect && !getWalker().isShallowQuery() ) { //TODO: is this a bit ugly? expr.setText( text ); } else { appender.append( SqlTokenTypes.SQL_TOKEN, text, false ); } } }
public boolean includeSubclasses( String alias ) { // The uber-rule here is that we need to include subclass joins if // the FromElement is in any way dereferenced by a property from // the subclass table; otherwise we end up with column references // qualified by a non-existent table reference in the resulting SQL... boolean containsTableAlias = fromClause.containsTableAlias(alias); if (fromElement.isDereferencedBySubclassProperty()) { // TODO : or should we return 'containsTableAlias'?? LOG.tracev( "Forcing inclusion of extra joins [alias={0}, containsTableAlias={1}]", alias, containsTableAlias ); return true; } boolean shallowQuery = walker.isShallowQuery(); boolean includeSubclasses = fromElement.isIncludeSubclasses(); boolean subQuery = fromClause.isSubQuery(); return includeSubclasses && containsTableAlias && !subQuery && !shallowQuery; } }
public boolean includeSubclasses( String alias ) { // The uber-rule here is that we need to include subclass joins if // the FromElement is in any way dereferenced by a property from // the subclass table; otherwise we end up with column references // qualified by a non-existent table reference in the resulting SQL... boolean containsTableAlias = fromClause.containsTableAlias(alias); if (fromElement.isDereferencedBySubclassProperty()) { // TODO : or should we return 'containsTableAlias'?? LOG.tracev( "Forcing inclusion of extra joins [alias={0}, containsTableAlias={1}]", alias, containsTableAlias ); return true; } boolean shallowQuery = walker.isShallowQuery(); boolean includeSubclasses = fromElement.isIncludeSubclasses(); boolean subQuery = fromClause.isSubQuery(); return includeSubclasses && containsTableAlias && !subQuery && !shallowQuery; } }
private void renderNonScalarIdentifiers(FromElement fromElement, int nonscalarSize, int j, SelectExpression expr, ASTAppender appender) { String text = fromElement.renderIdentifierSelect( nonscalarSize, j ); if ( !fromElement.getFromClause().isSubQuery() ) { if ( !scalarSelect && !getWalker().isShallowQuery() ) { //TODO: is this a bit ugly? expr.setText( text ); } else { appender.append( SqlTokenTypes.SQL_TOKEN, text, false ); } } }
if ( !currentFromClause.isSubQuery() ) {
if ( getWalker().isShallowQuery() || getWalker().getCurrentFromClause().isSubQuery() ) { resolve(false, true);