private Integer findAlias(Table table, Object key) { Integer alias = null; if (_aliases != null) { alias = (Integer) _aliases.get(key); if (alias != null) { return alias; } } if (_parent != null) { alias = _parent.findAlias(table, key); if (alias != null) { return alias; } } return alias; }
i = findAlias(table, key);
i = findAlias(table, key);
private Integer findAlias(Table table, Object key) { Integer alias = null; if (_aliases != null) { alias = (Integer) _aliases.get(key); if (alias != null) { return alias; } } if (_parent != null) { alias = _parent.findAlias(table, key); if (alias != null) { return alias; } } return alias; }
i = findAlias(table, key);
private Integer findAlias(Table table, Object key) { Integer alias = null; if (_aliases != null) { alias = (Integer) _aliases.get(key); if (alias != null) { return alias; } } if (_parent != null) { alias = _parent.findAlias(table, key); if (alias != null) { return alias; } } return alias; }
i = findAlias(table, key);
private Integer findAlias(Table table, Object key) { Integer alias = null; if (_aliases != null) { alias = (Integer) _aliases.get(key); if (alias != null) { return alias; } } if (_parent != null) { alias = _parent.findAlias(table, key); if (alias != null) { return alias; } } return alias; }
/** * Return the alias for the given table under the given joins. * NOTE: WE RELY ON THESE INDEXES BEING MONOTONICALLY INCREASING FROM 0 */ private int getTableIndex(Table table, PathJoins pj, boolean create) { // if we have a from select, then there are no table aliases if (_from != null) return -1; Object key = table.getFullName(); if (pj != null && pj.path() != null) key = new Key(pj.path().toString(), key); // check out existing aliases Integer i = findAlias(table, key, false, null); if (i != null) return i.intValue(); if (!create) return -1; // not found; create alias i = Numbers.valueOf(aliasSize()); recordTableAlias(table, key, i); return i.intValue(); }
private Integer findAliasForQuery(Table table, PathJoins pj, Object key, boolean create) { Integer i = null; SelectImpl sel = this; String alias = _schemaAlias; if (isPathInThisContext(pj) || table.isAssociation()) alias = null; // find the context where this alias is defined Context ctx = (alias != null) ? _ctx.findContext(alias) : null; if (ctx != null) sel = (SelectImpl) ctx.getSelect(); if (!create) i = sel.findAlias(table, key); // find in parent and in myself else i = sel.getAlias(table, key); // find in myself if (i != null) return i; if (create) { // create here i = sel.createAlias(table, key); } else if (ctx != null && ctx != ctx()) { // create in other select i = ((SelectImpl)ctx.getSelect()).createAlias(table, key); } return i; }
private Integer findAliasForQuery(Table table, PathJoins pj, Object key, boolean create) { Integer i = null; SelectImpl sel = this; String alias = _schemaAlias; if (isPathInThisContext(pj) || table.isAssociation()) alias = null; // find the context where this alias is defined Context ctx = (alias != null) ? _ctx.findContext(alias) : null; if (ctx != null) sel = (SelectImpl) ctx.getSelect(); if (!create) i = sel.findAlias(table, key); // find in parent and in myself else i = sel.getAlias(table, key); // find in myself if (i != null) return i; if (create) { // create here i = sel.createAlias(table, key); } else if (ctx != null && ctx != ctx()) { // create in other select i = ((SelectImpl)ctx.getSelect()).createAlias(table, key); } return i; }
private Integer findAliasForQuery(Table table, PathJoins pj, Object key, boolean create) { Integer i = null; SelectImpl sel = this; String alias = _schemaAlias; if (isPathInThisContext(pj) || table.isAssociation()) alias = null; // find the context where this alias is defined Context ctx = (alias != null) ? _ctx.findContext(alias) : null; if (ctx != null) sel = (SelectImpl) ctx.getSelect(); if (!create) i = sel.findAlias(table, key); // find in parent and in myself else i = sel.getAlias(table, key); // find in myself if (i != null) return i; if (create) { // create here i = sel.createAlias(table, key); } else if (ctx != null && ctx != ctx()) { // create in other select i = ((SelectImpl)ctx.getSelect()).createAlias(table, key); } return i; }
private Integer findAliasForQuery(Table table, PathJoins pj, Object key, boolean create) { Integer i = null; SelectImpl sel = this; String alias = _schemaAlias; if (isPathInThisContext(pj) || table.isAssociation()) alias = null; // find the context where this alias is defined Context ctx = (alias != null) ? _ctx.findContext(alias) : null; if (ctx != null) sel = (SelectImpl) ctx.getSelect(); if (!create) i = sel.findAlias(table, key); // find in parent and in myself else i = sel.getAlias(table, key); // find in myself if (i != null) return i; if (create) { // create here i = sel.createAlias(table, key); } else if (ctx != null && ctx != ctx()) { // create in other select i = ((SelectImpl)ctx.getSelect()).createAlias(table, key); } return i; }