public void appendIsNotNull(SQLBuffer sql, Select sel, Joins joins) { // if no inverse, just join to mapping's table (usually a no-op // because it'll be in the primary table) and see if fk cols aren't // null; if inverse, then we have to do a sub-select to see if any // inverse objects point back to this field's owner if (field.getJoinDirection() != field.JOIN_INVERSE) { //### probably need some sort of subselect here on fk constants joins = join(joins, false); Column[] cols = field.getColumns(); if (cols.length == 0) sql.append("1 = 1"); else sql.append(sel.getColumnAlias(cols[0], joins)). append(" IS NOT ").appendValue(null, cols[0]); } else testInverseNull(sql, sel, joins, false); }
public void appendIsNotNull(SQLBuffer sql, Select sel, Joins joins) { // if no inverse, just join to mapping's table (usually a no-op // because it'll be in the primary table) and see if fk cols aren't // null; if inverse, then we have to do a sub-select to see if any // inverse objects point back to this field's owner if (field.getJoinDirection() != field.JOIN_INVERSE) { //### probably need some sort of subselect here on fk constants joins = join(joins, false); Column[] cols = field.getColumns(); if (cols.length == 0) sql.append("1 = 1"); else sql.append(sel.getColumnAlias(cols[0], joins)). append(" IS NOT ").appendValue(null, cols[0]); } else testInverseNull(sql, sel, joins, false); }
public void appendIsNull(SQLBuffer sql, Select sel, Joins joins) { // if no inverse, just join to mapping's table (usually a no-op // because it'll be in the primary table) and see if fk cols are null; // if inverse, then we have to do a sub-select to see if any inverse // objects point back to this field's owner if (field.getJoinDirection() != field.JOIN_INVERSE) { //### probably need some sort of subselect here on fk constants joins = join(joins, false); Column[] cols = field.getColumns(); if (cols.length == 0) sql.append("1 <> 1"); else sql.append(sel.getColumnAlias(cols[0], joins)). append(" IS ").appendValue(null, cols[0]); } else testInverseNull(sql, sel, joins, true); }
public void appendIsNotNull(SQLBuffer sql, Select sel, Joins joins) { // if no inverse, just join to mapping's table (usually a no-op // because it'll be in the primary table) and see if fk cols aren't // null; if inverse, then we have to do a sub-select to see if any // inverse objects point back to this field's owner if (field.getJoinDirection() != field.JOIN_INVERSE) { //### probably need some sort of subselect here on fk constants joins = join(joins, false); Column[] cols = field.getColumns(); if (cols.length == 0) sql.append("1 = 1"); else sql.append(sel.getColumnAlias(cols[0], joins)). append(" IS NOT ").appendValue(null, cols[0]); } else testInverseNull(sql, sel, joins, false); }
public void appendIsNull(SQLBuffer sql, Select sel, Joins joins) { // if no inverse, just join to mapping's table (usually a no-op // because it'll be in the primary table) and see if fk cols are null; // if inverse, then we have to do a sub-select to see if any inverse // objects point back to this field's owner if (field.getJoinDirection() != field.JOIN_INVERSE) { //### probably need some sort of subselect here on fk constants joins = join(joins, false); Column[] cols = field.getColumns(); if (cols.length == 0) sql.append("1 <> 1"); else sql.append(sel.getColumnAlias(cols[0], joins)). append(" IS ").appendValue(null, cols[0]); } else testInverseNull(sql, sel, joins, true); }
public void appendIsNull(SQLBuffer sql, Select sel, Joins joins) { // if no inverse, just join to mapping's table (usually a no-op // because it'll be in the primary table) and see if fk cols are null; // if inverse, then we have to do a sub-select to see if any inverse // objects point back to this field's owner if (field.getJoinDirection() != field.JOIN_INVERSE) { //### probably need some sort of subselect here on fk constants joins = join(joins, false); Column[] cols = field.getColumns(); if (cols.length == 0) sql.append("1 <> 1"); else sql.append(sel.getColumnAlias(cols[0], joins)). append(" IS ").appendValue(null, cols[0]); } else testInverseNull(sql, sel, joins, true); }
public void appendIsNotNull(SQLBuffer sql, Select sel, Joins joins) { // if no inverse, just join to mapping's table (usually a no-op // because it'll be in the primary table) and see if fk cols aren't // null; if inverse, then we have to do a sub-select to see if any // inverse objects point back to this field's owner if (field.getJoinDirection() != field.JOIN_INVERSE) { //### probably need some sort of subselect here on fk constants joins = join(joins, false); Column[] cols = field.getColumns(); if (cols.length == 0) sql.append("1 = 1"); else sql.append(sel.getColumnAlias(cols[0], joins)). append(" IS NOT ").appendValue(null, cols[0]); } else testInverseNull(sql, sel, joins, false); }
public void appendIsNull(SQLBuffer sql, Select sel, Joins joins) { // if no inverse, just join to mapping's table (usually a no-op // because it'll be in the primary table) and see if fk cols are null; // if inverse, then we have to do a sub-select to see if any inverse // objects point back to this field's owner if (field.getJoinDirection() != field.JOIN_INVERSE) { //### probably need some sort of subselect here on fk constants joins = join(joins, false); Column[] cols = field.getColumns(); if (cols.length == 0) sql.append("1 <> 1"); else sql.append(sel.getColumnAlias(cols[0], joins)). append(" IS ").appendValue(null, cols[0]); } else testInverseNull(sql, sel, joins, true); }
public void appendIsNull(SQLBuffer sql, Select sel, Joins joins) { // if no inverse, just join to mapping's table (usually a no-op // because it'll be in the primary table) and see if fk cols are null; // if inverse, then we have to do a sub-select to see if any inverse // objects point back to this field's owner if (field.getJoinDirection() != field.JOIN_INVERSE) { //### probably need some sort of subselect here on fk constants joins = join(joins, false); Column[] cols = field.getColumns(); if (cols.length == 0) sql.append("1 <> 1"); else sql.append(sel.getColumnAlias(cols[0], joins)). append(" IS ").appendValue(null, cols[0]); } else testInverseNull(sql, sel, joins, true); }
public void appendIsNotNull(SQLBuffer sql, Select sel, Joins joins) { // if no inverse, just join to mapping's table (usually a no-op // because it'll be in the primary table) and see if fk cols aren't // null; if inverse, then we have to do a sub-select to see if any // inverse objects point back to this field's owner if (field.getJoinDirection() != field.JOIN_INVERSE) { //### probably need some sort of subselect here on fk constants joins = join(joins, false); Column[] cols = field.getColumns(); if (cols.length == 0) sql.append("1 = 1"); else sql.append(sel.getColumnAlias(cols[0], joins)). append(" IS NOT ").appendValue(null, cols[0]); } else testInverseNull(sql, sel, joins, false); }
/** * Add the joins needed to select/load eager data. */ private Joins eagerJoin(Joins joins, ClassMapping cls, boolean forceInner) { boolean inverse = field.getJoinDirection() == field.JOIN_INVERSE; if (!inverse) { joins = join(joins, false); joins = setEmbeddedVariable(joins); } // and join into relation ForeignKey fk = field.getForeignKey(cls); if (!forceInner && field.getNullValue() != FieldMapping.NULL_EXCEPTION) return joins.outerJoinRelation(field.getName(), fk, field. getTypeMapping(), field.getSelectSubclasses(), inverse, false); return joins.joinRelation(field.getName(), fk, field.getTypeMapping(), field.getSelectSubclasses(), inverse, false); }
/** * Add the joins needed to select/load eager data. */ private Joins eagerJoin(Joins joins, ClassMapping cls, boolean forceInner) { boolean inverse = field.getJoinDirection() == field.JOIN_INVERSE; if (!inverse) { joins = join(joins, false); joins = setEmbeddedVariable(joins); } // and join into relation ForeignKey fk = field.getForeignKey(cls); if (!forceInner && field.getNullValue() != FieldMapping.NULL_EXCEPTION) return joins.outerJoinRelation(field.getName(), fk, field. getTypeMapping(), field.getSelectSubclasses(), inverse, false); return joins.joinRelation(field.getName(), fk, field.getTypeMapping(), field.getSelectSubclasses(), inverse, false); }
/** * Add the joins needed to select/load eager data. */ private Joins eagerJoin(Joins joins, ClassMapping cls, boolean forceInner) { boolean inverse = field.getJoinDirection() == field.JOIN_INVERSE; if (!inverse) { joins = join(joins, false); joins = setEmbeddedVariable(joins); } // and join into relation ForeignKey fk = field.getForeignKey(cls); if (!forceInner && field.getNullValue() != FieldMapping.NULL_EXCEPTION) return joins.outerJoinRelation(field.getName(), fk, field. getTypeMapping(), field.getSelectSubclasses(), inverse, false); return joins.joinRelation(field.getName(), fk, field.getTypeMapping(), field.getSelectSubclasses(), inverse, false); }
/** * Add the joins needed to select/load eager data. */ private Joins eagerJoin(Joins joins, ClassMapping cls, boolean forceInner) { boolean inverse = field.getJoinDirection() == field.JOIN_INVERSE; if (!inverse) { joins = join(joins, false); joins = setEmbeddedVariable(joins); } // and join into relation ForeignKey fk = field.getForeignKey(cls); if (!forceInner && field.getNullValue() != FieldMapping.NULL_EXCEPTION) return joins.outerJoinRelation(field.getName(), fk, field. getTypeMapping(), field.getSelectSubclasses(), inverse, false); return joins.joinRelation(field.getName(), fk, field.getTypeMapping(), field.getSelectSubclasses(), inverse, false); }
/** * Add the joins needed to select/load eager data. */ private Joins eagerJoin(Joins joins, ClassMapping cls, boolean forceInner) { boolean inverse = field.getJoinDirection() == field.JOIN_INVERSE; if (!inverse) { joins = join(joins, false); joins = setEmbeddedVariable(joins); } // and join into relation ForeignKey fk = field.getForeignKey(cls); if (!forceInner && field.getNullValue() != FieldMapping.NULL_EXCEPTION) return joins.outerJoinRelation(field.getName(), fk, field. getTypeMapping(), field.getSelectSubclasses(), inverse, false); return joins.joinRelation(field.getName(), fk, field.getTypeMapping(), field.getSelectSubclasses(), inverse, false); }