/** * Add table join with table alias based on prefix. */ @Override public SqlJoinType addJoin(SqlJoinType joinType, String prefix, DbSqlContext ctx) { return tableJoin.addJoin(joinType, prefix, ctx); }
/** * Add table join with explicit table alias. */ @Override public SqlJoinType addJoin(SqlJoinType joinType, String a1, String a2, DbSqlContext ctx) { return tableJoin.addJoin(joinType, a1, a2, ctx); }
@Override void appendFrom(DbSqlContext ctx, SqlJoinType joinType) { // add join to support the discriminator column String relativePrefix = ctx.getRelativePrefix(property.name); property.tableJoin.addJoin(joinType, relativePrefix, ctx); }
@Override void appendFrom(DbSqlContext ctx, SqlJoinType joinType) { String relativePrefix = ctx.getRelativePrefix(property.getName()); if (softDelete && !ctx.isIncludeSoftDelete()) { property.tableJoin.addJoin(joinType, relativePrefix, ctx, softDeletePredicate); } else { property.tableJoin.addJoin(joinType, relativePrefix, ctx); } } }
/** * Add any extra joins required to support this property. Generally a no * operation except for a OneToOne exported. */ @Override public void appendFrom(DbSqlContext ctx, SqlJoinType joinType) { if (formula && sqlFormulaJoin != null) { ctx.appendFormulaJoin(sqlFormulaJoin, joinType); } else if (secondaryTableJoin != null) { String relativePrefix = ctx.getRelativePrefix(secondaryTableJoinPrefix); secondaryTableJoin.addJoin(joinType, relativePrefix, ctx); } }
public SqlJoinType addJoin(SqlJoinType joinType, String prefix, DbSqlContext ctx) { String[] names = SplitName.split(prefix); String a1 = ctx.getTableAlias(names[0]); String a2 = ctx.getTableAlias(prefix); return addJoin(joinType, a1, a2, ctx); }
sb.append(targetDescriptor.getBaseTable(query.getTemporalMode())); sb.append(" x2 on "); inverseJoin.addJoin("x2", "x", sb); } else { sb.append(" x");
/** * For the root node there is no join type or on clause etc. */ @Override public SqlJoinType appendFromBaseTable(DbSqlContext ctx, SqlJoinType joinType) { ctx.append(baseTable); ctx.append(" ").append(baseTableAlias); ctx.appendFromForUpdate(); if (includeJoin != null) { String a1 = baseTableAlias; String a2 = "int_"; // unique alias for intersection join includeJoin.addJoin(joinType, a1, a2, ctx); } return joinType; }
public SqlJoinType addJoin(SqlJoinType joinType, String prefix, DbSqlContext ctx, String predicate) { String[] names = SplitName.split(prefix); String a1 = ctx.getTableAlias(names[0]); String a2 = ctx.getTableAlias(prefix); SqlJoinType returnJoinType = addJoin(joinType, a1, a2, ctx); ctx.append("and ").append(a2).append(predicate); return returnJoinType; }
/** * Join to base table for this node. This includes a join to the * intersection table if this is a ManyToMany node. */ private void appendFromBaseTable(DbSqlContext ctx, SqlJoinType joinType) { String alias = ctx.getTableAliasManyWhere(prefix); String parentAlias = ctx.getTableAliasManyWhere(parentPrefix); if (nodeBeanProp instanceof STreePropertyAssocOne) { nodeBeanProp.addJoin(joinType, parentAlias, alias, ctx); } else { STreePropertyAssocMany manyProp = (STreePropertyAssocMany) nodeBeanProp; if (!manyProp.hasJoinTable()) { manyProp.addJoin(joinType, parentAlias, alias, ctx); } else { String alias2 = alias + "z_"; TableJoin manyToManyJoin = manyProp.getIntersectionTableJoin(); manyToManyJoin.addJoin(joinType, parentAlias, alias2, ctx); manyProp.addJoin(joinType, alias2, alias, ctx); } } }
/** * Add table join with table alias based on prefix. */ @Override public SqlJoinType addJoin(SqlJoinType joinType, String prefix, DbSqlContext ctx) { return tableJoin.addJoin(joinType, prefix, ctx); }
/** * Add table join with explicit table alias. */ @Override public SqlJoinType addJoin(SqlJoinType joinType, String a1, String a2, DbSqlContext ctx) { return tableJoin.addJoin(joinType, a1, a2, ctx); }
protected SqlJoinType appendFromAsJoin(DbSqlContext ctx, SqlJoinType joinType) { if (nodeBeanProp instanceof STreePropertyAssocMany) { STreePropertyAssocMany manyProp = (STreePropertyAssocMany) nodeBeanProp; if (manyProp.hasJoinTable()) { String alias = ctx.getTableAlias(prefix); String[] split = SplitName.split(prefix); String parentAlias = ctx.getTableAlias(split[0]); String alias2 = alias + "z_"; // adding the additional join to the intersection table TableJoin manyToManyJoin = manyProp.getIntersectionTableJoin(); manyToManyJoin.addJoin(joinType, parentAlias, alias2, ctx); if (!manyProp.isExcludedFromHistory()) { intersectionAsOfTableAlias = true; } return nodeBeanProp.addJoin(joinType, alias2, alias, ctx); } } return nodeBeanProp.addJoin(joinType, prefix, ctx); }
manyToManyJoin.addJoin(joinType, parentAlias, alias2, ctx);
@Override void appendFrom(DbSqlContext ctx, SqlJoinType joinType) { // add join to support the discriminator column String relativePrefix = ctx.getRelativePrefix(property.name); property.tableJoin.addJoin(joinType, relativePrefix, ctx); }
@Override void appendFrom(DbSqlContext ctx, SqlJoinType joinType) { String relativePrefix = ctx.getRelativePrefix(property.getName()); if (softDelete && !ctx.isIncludeSoftDelete()) { property.tableJoin.addJoin(joinType, relativePrefix, ctx, softDeletePredicate); } else { property.tableJoin.addJoin(joinType, relativePrefix, ctx); } } }
/** * Add any extra joins required to support this property. Generally a no * operation except for a OneToOne exported. */ @Override public void appendFrom(DbSqlContext ctx, SqlJoinType joinType) { if (formula && sqlFormulaJoin != null) { ctx.appendFormulaJoin(sqlFormulaJoin, joinType); } else if (secondaryTableJoin != null) { String relativePrefix = ctx.getRelativePrefix(secondaryTableJoinPrefix); secondaryTableJoin.addJoin(joinType, relativePrefix, ctx); } }
public SqlJoinType addJoin(SqlJoinType joinType, String prefix, DbSqlContext ctx) { String[] names = SplitName.split(prefix); String a1 = ctx.getTableAlias(names[0]); String a2 = ctx.getTableAlias(prefix); return addJoin(joinType, a1, a2, ctx); }
/** * For the root node there is no join type or on clause etc. */ @Override public SqlJoinType appendFromBaseTable(DbSqlContext ctx, SqlJoinType joinType) { ctx.append(baseTable); ctx.append(" ").append(baseTableAlias); ctx.appendFromForUpdate(); if (includeJoin != null) { String a1 = baseTableAlias; String a2 = "int_"; // unique alias for intersection join includeJoin.addJoin(joinType, a1, a2, ctx); } return joinType; }
public SqlJoinType addJoin(SqlJoinType joinType, String prefix, DbSqlContext ctx, String predicate) { String[] names = SplitName.split(prefix); String a1 = ctx.getTableAlias(names[0]); String a2 = ctx.getTableAlias(prefix); SqlJoinType returnJoinType = addJoin(joinType, a1, a2, ctx); ctx.append("and ").append(a2).append(predicate); return returnJoinType; }