ClassMapping base = mapping;
while (base.getJoinablePCSuperclassMapping() != null)
base = base.getJoinablePCSuperclassMapping();
Select sel = _sql.newSelect();
sel.select(base.getPrimaryKeyColumns());
sel.wherePrimaryKey(sm.getObjectId(), base, this);
if (_log.isTraceEnabled()) {
_log.trace("selectPrimaryKey: oid="+sm.getObjectId()+" "+mapping.getDescribedType());
}
Result exists = sel.execute(this, fetch);