protected void appendDisplayText(StringBuilder buf) { buf.append( isImplied() ? ( isImpliedInFromClause() ? "implied in FROM clause" : "implied" ) : "explicit" ); buf.append( "," ).append( isCollectionJoin() ? "collection join" : "not a collection join" ); buf.append( "," ).append( fetch ? "fetch join" : "not a fetch join" ); buf.append( "," ).append( isAllPropertyFetch ? "fetch all properties" : "fetch non-lazy properties" ); buf.append( ",classAlias=" ).append( getClassAlias() ); buf.append( ",role=" ).append( role ); buf.append( ",tableName=" ).append( getTableName() ); buf.append( ",tableAlias=" ).append( getTableAlias() ); FromElement origin = getRealOrigin(); buf.append( ",origin=" ).append( origin == null ? "null" : origin.getText() ); buf.append( ",columns={" ); if ( columns != null ) { for ( int i = 0; i < columns.length; i++ ) { buf.append( columns[i] ); if ( i < columns.length ) { buf.append( " " ); } } } buf.append( ",className=" ).append( className ); buf.append( "}" ); }
private void prepareAnyImplicitJoins(DotNode dotNode) throws SemanticException { if ( dotNode.getLhs() instanceof DotNode ) { DotNode lhs = (DotNode) dotNode.getLhs(); FromElement lhsOrigin = lhs.getFromElement(); if ( lhsOrigin != null && "".equals( lhsOrigin.getText() ) ) { String lhsOriginText = lhsOrigin.getQueryable().getTableName() + " " + lhsOrigin.getTableAlias(); lhsOrigin.setText( lhsOriginText ); } prepareAnyImplicitJoins( lhs ); } }
protected void appendDisplayText(StringBuilder buf) { buf.append( isImplied() ? ( isImpliedInFromClause() ? "implied in FROM clause" : "implied" ) : "explicit" ); buf.append( "," ).append( isCollectionJoin() ? "collection join" : "not a collection join" ); buf.append( "," ).append( fetch ? "fetch join" : "not a fetch join" ); buf.append( "," ).append( isAllPropertyFetch ? "fetch all properties" : "fetch non-lazy properties" ); buf.append( ",classAlias=" ).append( getClassAlias() ); buf.append( ",role=" ).append( role ); buf.append( ",tableName=" ).append( getTableName() ); buf.append( ",tableAlias=" ).append( getTableAlias() ); FromElement origin = getRealOrigin(); buf.append( ",origin=" ).append( origin == null ? "null" : origin.getText() ); buf.append( ",columns={" ); if ( columns != null ) { for ( int i = 0; i < columns.length; i++ ) { buf.append( columns[i] ); if ( i < columns.length ) { buf.append( " " ); } } } buf.append( ",className=" ).append( className ); buf.append( "}" ); }
protected void appendDisplayText(StringBuilder buf) { buf.append( isImplied() ? ( isImpliedInFromClause() ? "implied in FROM clause" : "implied" ) : "explicit" ); buf.append( "," ).append( isCollectionJoin() ? "collection join" : "not a collection join" ); buf.append( "," ).append( fetch ? "fetch join" : "not a fetch join" ); buf.append( "," ).append( isAllPropertyFetch ? "fetch all properties" : "fetch non-lazy properties" ); buf.append( ",classAlias=" ).append( getClassAlias() ); buf.append( ",role=" ).append( role ); buf.append( ",tableName=" ).append( getTableName() ); buf.append( ",tableAlias=" ).append( getTableAlias() ); FromElement origin = getRealOrigin(); buf.append( ",origin=" ).append( origin == null ? "null" : origin.getText() ); buf.append( ",columns={" ); if ( columns != null ) { for ( int i = 0; i < columns.length; i++ ) { buf.append( columns[i] ); if ( i < columns.length ) { buf.append( " " ); } } } buf.append( ",className=" ).append( className ); buf.append( "}" ); }
@SuppressWarnings("unchecked") protected boolean shouldUseDistinctQuery() { if (this.pathPlan.containsCollectionJoins()) { return true; } QueryNode queryNode = (QueryNode)this.getSqlAST(); boolean foundFrom = false; for (FromElement fromElement : (List<FromElement>)queryNode.getFromClause().getFromElements()) { if (fromElement.getClass() == FromElement.class ) { if (!fromElement.getText().contains(" join ")) { if (foundFrom) { return true; } foundFrom = true; } else if (fromElement.getText().startsWith("cross ")) { return true; } else if (fromElement.getQueryableCollection() != null) { return true; } } } return false; }
for (FromElement fromElement : (List<FromElement>)queryNode.getFromClause().getFromElements()) { if (fromElement.getClass() == FromElement.class ) { if (!fromElement.getText().contains(" join ")) { if (foundFrom) { return true; } else if (fromElement.getText().startsWith("cross ")) { return true; } else if (fromElement.getQueryableCollection() != null) { if (!fromElement.getText().startsWith("left ")) { return true;
private void prepareAnyImplicitJoins(DotNode dotNode) throws SemanticException { if ( dotNode.getLhs() instanceof DotNode ) { DotNode lhs = ( DotNode ) dotNode.getLhs(); FromElement lhsOrigin = lhs.getFromElement(); if ( lhsOrigin != null && "".equals( lhsOrigin.getText() ) ) { String lhsOriginText = lhsOrigin.getQueryable().getTableName() + " " + lhsOrigin.getTableAlias(); lhsOrigin.setText( lhsOriginText ); } prepareAnyImplicitJoins( lhs ); } }
private void prepareAnyImplicitJoins(DotNode dotNode) throws SemanticException { if ( dotNode.getLhs() instanceof DotNode ) { DotNode lhs = ( DotNode ) dotNode.getLhs(); FromElement lhsOrigin = lhs.getFromElement(); if ( lhsOrigin != null && "".equals( lhsOrigin.getText() ) ) { String lhsOriginText = lhsOrigin.getQueryable().getTableName() + " " + lhsOrigin.getTableAlias(); lhsOrigin.setText( lhsOriginText ); } prepareAnyImplicitJoins( lhs ); } }
if (fromElement.getClass() == FromElement.class && fromElement.getWithClauseFragment() == null) { if (distinct || fromElement.getQueryableCollection() == null) { if (fromElement.getText().startsWith("left ")) { continue; } else if (fromElement.getRole() != null &&