private boolean exists(ClassMapping mapping, Object oid, Object context) { // add where conditions on base class to avoid joins if subclass // doesn't use oid as identifier Select sel = _sql.newSelect(); while (mapping.getJoinablePCSuperclassMapping() != null) mapping = mapping.getJoinablePCSuperclassMapping(); sel.wherePrimaryKey(oid, mapping, this); try { return sel.getCount(this) != 0; } catch (SQLException se) { throw SQLExceptions.getStore(se, _dict); } }
private boolean exists(ClassMapping mapping, Object oid, Object context) { // add where conditions on base class to avoid joins if subclass // doesn't use oid as identifier Select sel = _sql.newSelect(); while (mapping.getJoinablePCSuperclassMapping() != null) mapping = mapping.getJoinablePCSuperclassMapping(); sel.wherePrimaryKey(oid, mapping, this); if (_log.isTraceEnabled()) { _log.trace("exists: oid="+oid+" "+mapping.getDescribedType()); } try { return sel.getCount(this) != 0; } catch (SQLException se) { throw SQLExceptions.getStore(se, _dict); } }
private boolean exists(ClassMapping mapping, Object oid, Object context) { // add where conditions on base class to avoid joins if subclass // doesn't use oid as identifier Select sel = _sql.newSelect(); while (mapping.getJoinablePCSuperclassMapping() != null) mapping = mapping.getJoinablePCSuperclassMapping(); sel.wherePrimaryKey(oid, mapping, this); if (_log.isTraceEnabled()) { _log.trace("exists: oid="+oid+" "+mapping.getDescribedType()); } try { return sel.getCount(this) != 0; } catch (SQLException se) { throw SQLExceptions.getStore(se, _dict); } }
private boolean exists(ClassMapping mapping, Object oid, Object context) { // add where conditions on base class to avoid joins if subclass // doesn't use oid as identifier Select sel = _sql.newSelect(); while (mapping.getJoinablePCSuperclassMapping() != null) mapping = mapping.getJoinablePCSuperclassMapping(); sel.wherePrimaryKey(oid, mapping, this); if (_log.isTraceEnabled()) { _log.trace("exists: oid="+oid+" "+mapping.getDescribedType()); } try { return sel.getCount(this) != 0; } catch (SQLException se) { throw SQLExceptions.getStore(se, _dict); } }
private boolean exists(ClassMapping mapping, Object oid, Object context) { // add where conditions on base class to avoid joins if subclass // doesn't use oid as identifier Select sel = _sql.newSelect(); while (mapping.getJoinablePCSuperclassMapping() != null) mapping = mapping.getJoinablePCSuperclassMapping(); sel.wherePrimaryKey(oid, mapping, this); if (_log.isTraceEnabled()) { _log.trace("exists: oid="+oid+" "+mapping.getDescribedType()); } try { return sel.getCount(this) != 0; } catch (SQLException se) { throw SQLExceptions.getStore(se, _dict); } }