public SQLBuffer getClassConditions(Select sel, Joins joins, ClassMapping base, boolean subclasses) { return disc.getClassMapping().getPCSuperclassMapping(). getDiscriminator().getClassConditions(sel, joins, base, subclasses); } }
public SQLBuffer getClassConditions(Select sel, Joins joins, ClassMapping base, boolean subclasses) { return disc.getClassMapping().getPCSuperclassMapping(). getDiscriminator().getClassConditions(sel, joins, base, subclasses); } }
public SQLBuffer getClassConditions(Select sel, Joins joins, ClassMapping base, boolean subclasses) { return disc.getClassMapping().getPCSuperclassMapping(). getDiscriminator().getClassConditions(sel, joins, base, subclasses); } }
public SQLBuffer getClassConditions(Select sel, Joins joins, ClassMapping base, boolean subclasses) { return disc.getClassMapping().getPCSuperclassMapping(). getDiscriminator().getClassConditions(sel, joins, base, subclasses); } }
public SQLBuffer getClassConditions(Select sel, Joins joins, ClassMapping base, boolean subclasses) { return disc.getClassMapping().getPCSuperclassMapping(). getDiscriminator().getClassConditions(sel, joins, base, subclasses); } }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) { // if no class indicator or a final class, just append true or false // depending on whether the cast matches the expected type InstanceofExpState istate = (InstanceofExpState) state; if (istate.discrim == null) { if (_cls.isAssignableFrom(istate.rel)) sql.append("1 = 1"); else sql.append("1 <> 1"); } else { ctx.store.loadSubclasses(istate.discrim.getClassMapping()); SQLBuffer buf = istate.discrim.getClassConditions(sel, istate.joins, istate.mapping, true); sql.append(buf); } sel.append(sql, istate.joins); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) { // if no class indicator or a final class, just append true or false // depending on whether the cast matches the expected type InstanceofExpState istate = (InstanceofExpState) state; if (istate.discrim == null) { if (_cls.isAssignableFrom(istate.rel)) sql.append("1 = 1"); else sql.append("1 <> 1"); } else { ctx.store.loadSubclasses(istate.discrim.getClassMapping()); SQLBuffer buf = istate.discrim.getClassConditions(sel, istate.joins, istate.mapping, true); sql.append(buf); } sel.append(sql, istate.joins); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) { // if no class indicator or a final class, just append true or false // depending on whether the cast matches the expected type InstanceofExpState istate = (InstanceofExpState) state; if (istate.discrim == null) { if (_cls.isAssignableFrom(istate.rel)) sql.append("1 = 1"); else sql.append("1 <> 1"); } else { ctx.store.loadSubclasses(istate.discrim.getClassMapping()); SQLBuffer buf = istate.discrim.getClassConditions(sel, istate.joins, istate.mapping, true); sql.append(buf); } sel.append(sql, istate.joins); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) { // if no class indicator or a final class, just append true or false // depending on whether the cast matches the expected type InstanceofExpState istate = (InstanceofExpState) state; if (istate.discrim == null) { if (_cls.isAssignableFrom(istate.rel)) sql.append("1 = 1"); else sql.append("1 <> 1"); } else { ctx.store.loadSubclasses(istate.discrim.getClassMapping()); SQLBuffer buf = istate.discrim.getClassConditions(sel, istate.joins, istate.mapping, true); sql.append(buf); } sel.append(sql, istate.joins); }
public void appendTo(Select sel, ExpContext ctx, ExpState state, SQLBuffer sql) { // if no class indicator or a final class, just append true or false // depending on whether the cast matches the expected type InstanceofExpState istate = (InstanceofExpState) state; if (istate.discrim == null) { if (_cls.isAssignableFrom(istate.rel)) sql.append("1 = 1"); else sql.append("1 <> 1"); } else { ctx.store.loadSubclasses(istate.discrim.getClassMapping()); SQLBuffer buf = istate.discrim.getClassConditions(sel, istate.joins, istate.mapping, true); sql.append(buf); } sel.append(sql, istate.joins); }
/** * Add WHERE conditions to the given select limiting the returned results * to our mapping type, possibly including subclasses. */ public boolean addClassConditions(Select sel, boolean subs, Joins joins) { if (_mapping.getJoinablePCSuperclassMapping() == null && _mapping.getJoinablePCSubclassMappings().length == 0) return false; if (!hasClassConditions(_mapping, subs)) return false; // join down to base class where conditions will be added ClassMapping from = _mapping; ClassMapping sup = _mapping.getJoinablePCSuperclassMapping(); for (; sup != null; from = sup, sup = from .getJoinablePCSuperclassMapping()) { if (from.getTable() != sup.getTable()) { if (joins == null) joins = sel.newJoins(); joins = from.joinSuperclass(joins, false); } } sel.where(getClassConditions(sel, joins, _mapping, subs), joins); return true; }
/** * Add WHERE conditions to the given select limiting the returned results * to our mapping type, possibly including subclasses. */ public boolean addClassConditions(Select sel, boolean subs, Joins joins) { if (_mapping.getJoinablePCSuperclassMapping() == null && _mapping.getJoinablePCSubclassMappings().length == 0) return false; if (!hasClassConditions(_mapping, subs)) return false; // join down to base class where conditions will be added ClassMapping from = _mapping; ClassMapping sup = _mapping.getJoinablePCSuperclassMapping(); for (; sup != null; from = sup, sup = from .getJoinablePCSuperclassMapping()) { if (from.getTable() != sup.getTable()) { if (joins == null) joins = sel.newJoins(); joins = from.joinSuperclass(joins, false); } } sel.where(getClassConditions(sel, joins, _mapping, subs), joins); return true; }
/** * Add WHERE conditions to the given select limiting the returned results * to our mapping type, possibly including subclasses. */ public boolean addClassConditions(Select sel, boolean subs, Joins joins) { if (_mapping.getJoinablePCSuperclassMapping() == null && _mapping.getJoinablePCSubclassMappings().length == 0) return false; if (!hasClassConditions(_mapping, subs)) return false; // join down to base class where conditions will be added ClassMapping from = _mapping; ClassMapping sup = _mapping.getJoinablePCSuperclassMapping(); for (; sup != null; from = sup, sup = from .getJoinablePCSuperclassMapping()) { if (from.getTable() != sup.getTable()) { if (joins == null) joins = sel.newJoins(); joins = from.joinSuperclass(joins, false); } } sel.where(getClassConditions(sel, joins, _mapping, subs), joins); return true; }
/** * Add WHERE conditions to the given select limiting the returned results * to our mapping type, possibly including subclasses. */ public boolean addClassConditions(Select sel, boolean subs, Joins joins) { if (_mapping.getJoinablePCSuperclassMapping() == null && _mapping.getJoinablePCSubclassMappings().length == 0) return false; if (!hasClassConditions(_mapping, subs)) return false; // join down to base class where conditions will be added ClassMapping from = _mapping; ClassMapping sup = _mapping.getJoinablePCSuperclassMapping(); for (; sup != null; from = sup, sup = from .getJoinablePCSuperclassMapping()) { if (from.getTable() != sup.getTable()) { if (joins == null) joins = sel.newJoins(); joins = from.joinSuperclass(joins, false); } } sel.where(getClassConditions(sel, joins, _mapping, subs), joins); return true; }
/** * Add WHERE conditions to the given select limiting the returned results * to our mapping type, possibly including subclasses. */ public boolean addClassConditions(Select sel, boolean subs, Joins joins) { if (_mapping.getJoinablePCSuperclassMapping() == null && _mapping.getJoinablePCSubclassMappings().length == 0) return false; if (!hasClassConditions(_mapping, subs)) return false; // join down to base class where conditions will be added ClassMapping from = _mapping; ClassMapping sup = _mapping.getJoinablePCSuperclassMapping(); for (; sup != null; from = sup, sup = from .getJoinablePCSuperclassMapping()) { if (from.getTable() != sup.getTable()) { if (joins == null) joins = sel.newJoins(); joins = from.joinSuperclass(joins, false); } } sel.where(getClassConditions(sel, joins, _mapping, subs), joins); return true; }