@Override public void appendGroupBy(DbSqlContext ctx, boolean subQuery) { ctx.pushJoin(prefix); ctx.pushTableAlias(prefix); if (lazyLoadParent != null) { lazyLoadParent.addSelectExported(ctx, prefix); } if (readId) { appendSelectId(ctx, idBinder.getBeanProperty()); } for (STreeProperty property : properties) { if (!property.isAggregation()) { property.appendSelect(ctx, subQuery); } } for (SqlTreeNode aChildren : children) { aChildren.appendGroupBy(ctx, subQuery); } ctx.popTableAlias(); ctx.popJoin(); }
/** * Append to the FROM clause for this node. */ @Override public void appendFrom(DbSqlContext ctx, SqlJoinType joinType) { if (nodeBeanProp != null && nodeBeanProp.isFormula()) { // add joins for formula beans nodeBeanProp.appendFrom(ctx, joinType); } ctx.pushJoin(prefix); ctx.pushTableAlias(prefix); baseTableAlias = ctx.getTableAlias(prefix); // join and return SqlJoinType to use for child joins joinType = appendFromBaseTable(ctx, joinType); for (STreeProperty property : properties) { // usually nothing... except for 1-1 Exported property.appendFrom(ctx, joinType); } for (SqlTreeNode aChildren : children) { aChildren.appendFrom(ctx, joinType); } ctx.popTableAlias(); ctx.popJoin(); }
/** * Append the property columns to the buffer. */ @Override public void appendSelect(DbSqlContext ctx, boolean subQuery) { ctx.pushJoin(prefix); ctx.pushTableAlias(prefix); if (temporalVersions) { // select sys_period lower and upper columns ctx.appendHistorySysPeriod(); } if (lazyLoadParent != null) { lazyLoadParent.addSelectExported(ctx, prefix); } if (readId) { if (!subQuery && inheritInfo != null) { ctx.appendColumn(inheritInfo.getDiscriminatorColumn()); } appendSelectId(ctx, idBinder.getBeanProperty()); } appendSelect(ctx, subQuery, properties); for (SqlTreeNode aChildren : children) { // read each child... and let them set their // values back to this localBean aChildren.appendSelect(ctx, subQuery); } ctx.popTableAlias(); ctx.popJoin(); }
@Override public void appendGroupBy(DbSqlContext ctx, boolean subQuery) { ctx.pushJoin(prefix); ctx.pushTableAlias(prefix); if (lazyLoadParent != null) { lazyLoadParent.addSelectExported(ctx, prefix); } if (readId) { appendSelectId(ctx, idBinder.getBeanProperty()); } for (STreeProperty property : properties) { if (!property.isAggregation()) { property.appendSelect(ctx, subQuery); } } for (SqlTreeNode aChildren : children) { aChildren.appendGroupBy(ctx, subQuery); } ctx.popTableAlias(); ctx.popJoin(); }
/** * Append to the FROM clause for this node. */ @Override public void appendFrom(DbSqlContext ctx, SqlJoinType joinType) { if (nodeBeanProp != null && nodeBeanProp.isFormula()) { // add joins for formula beans nodeBeanProp.appendFrom(ctx, joinType); } ctx.pushJoin(prefix); ctx.pushTableAlias(prefix); baseTableAlias = ctx.getTableAlias(prefix); // join and return SqlJoinType to use for child joins joinType = appendFromBaseTable(ctx, joinType); for (STreeProperty property : properties) { // usually nothing... except for 1-1 Exported property.appendFrom(ctx, joinType); } for (SqlTreeNode aChildren : children) { aChildren.appendFrom(ctx, joinType); } ctx.popTableAlias(); ctx.popJoin(); }
/** * Append the property columns to the buffer. */ @Override public void appendSelect(DbSqlContext ctx, boolean subQuery) { ctx.pushJoin(prefix); ctx.pushTableAlias(prefix); if (temporalVersions) { // select sys_period lower and upper columns ctx.appendHistorySysPeriod(); } if (lazyLoadParent != null) { lazyLoadParent.addSelectExported(ctx, prefix); } if (readId) { if (!subQuery && inheritInfo != null) { ctx.appendColumn(inheritInfo.getDiscriminatorColumn()); } appendSelectId(ctx, idBinder.getBeanProperty()); } appendSelect(ctx, subQuery, properties); for (SqlTreeNode aChildren : children) { // read each child... and let them set their // values back to this localBean aChildren.appendSelect(ctx, subQuery); } ctx.popTableAlias(); ctx.popJoin(); }