/** * Select primary key data to make sure the given instance exists, locking * if needed. */ private boolean selectPrimaryKey(OpenJPAStateManager sm, ClassMapping mapping, JDBCFetchConfiguration fetch) throws SQLException { // select pks from base class record to ensure it exists and lock // it if needed ClassMapping base = mapping; while (base.getJoinablePCSuperclassMapping() != null) base = base.getJoinablePCSuperclassMapping(); Select sel = _sql.newSelect(); sel.select(base.getPrimaryKeyColumns()); sel.wherePrimaryKey(sm.getObjectId(), base, this); Result exists = sel.execute(this, fetch); try { if (isEmptyResult(exists)) return false; // record locked? if (_active && _lm != null && exists.isLocking()) _lm.loadedForUpdate(sm); return true; } finally { exists.close(); } }
if (res == null && !selectPrimaryKey(sm, mapping, fetch)) return false; if (isEmptyResult(res)) return false; } else { res = getInitializeStateUnionResult(sm, mapping, mappings, fetch); if (isEmptyResult(res)) return false;
res = sel.execute(this, jfetch, lockLevel); try { if (isEmptyResult(res)) return false; load(mapping, sm, jfetch, res);
if (res == null && !selectPrimaryKey(sm, mapping, fetch)) return false; if (isEmptyResult(res)) return false; } else { res = getInitializeStateUnionResult(sm, mapping, mappings, fetch); if (isEmptyResult(res)) return false;
/** * Select primary key data to make sure the given instance exists, locking * if needed. */ private boolean selectPrimaryKey(OpenJPAStateManager sm, ClassMapping mapping, JDBCFetchConfiguration fetch) throws SQLException { // select pks from base class record to ensure it exists and lock // it if needed 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); try { if (isEmptyResult(exists)) return false; // record locked? if (_active && _lm != null && exists.isLocking()) _lm.loadedForUpdate(sm); return true; } finally { exists.close(); } }
/** * Select primary key data to make sure the given instance exists, locking * if needed. */ private boolean selectPrimaryKey(OpenJPAStateManager sm, ClassMapping mapping, JDBCFetchConfiguration fetch) throws SQLException { // select pks from base class record to ensure it exists and lock // it if needed 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); try { if (isEmptyResult(exists)) return false; // record locked? if (_active && _lm != null && exists.isLocking()) _lm.loadedForUpdate(sm); return true; } finally { exists.close(); } }
if (res == null && !selectPrimaryKey(sm, mapping, fetch)) return false; if (isEmptyResult(res)) return false; } else { res = getInitializeStateUnionResult(sm, mapping, mappings, fetch); if (isEmptyResult(res)) return false;
/** * Select primary key data to make sure the given instance exists, locking * if needed. */ private boolean selectPrimaryKey(OpenJPAStateManager sm, ClassMapping mapping, JDBCFetchConfiguration fetch) throws SQLException { // select pks from base class record to ensure it exists and lock // it if needed 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); try { if (isEmptyResult(exists)) return false; // record locked? if (_active && _lm != null && exists.isLocking()) _lm.loadedForUpdate(sm); return true; } finally { exists.close(); } }
if (res == null && !selectPrimaryKey(sm, mapping, fetch)) return false; if (isEmptyResult(res)) return false; } else { res = getInitializeStateUnionResult(sm, mapping, mappings, fetch); if (isEmptyResult(res)) return false;
if (res == null && !selectPrimaryKey(sm, mapping, fetch)) return false; if (isEmptyResult(res)) return false; } else { res = getInitializeStateUnionResult(sm, mapping, mappings, fetch); if (isEmptyResult(res)) return false;
/** * Select primary key data to make sure the given instance exists, locking * if needed. */ private boolean selectPrimaryKey(OpenJPAStateManager sm, ClassMapping mapping, JDBCFetchConfiguration fetch) throws SQLException { // select pks from base class record to ensure it exists and lock // it if needed 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); try { if (isEmptyResult(exists)) return false; // record locked? if (_active && _lm != null && exists.isLocking()) _lm.loadedForUpdate(sm); return true; } finally { exists.close(); } }
if (isEmptyResult(res)) return false; load(mapping, sm, jfetch, res);
if (isEmptyResult(res)) return false; load(mapping, sm, jfetch, res);
if (isEmptyResult(res)) return false; load(mapping, sm, jfetch, res);
if (isEmptyResult(res)) return false; load(mapping, sm, jfetch, res);