/** * This method makes sure we don't already have the instance cached */ protected void checkForDuplicateId(Object id, Object obj) { StateManagerImpl other = getStateManagerImplById(id, false); if (other != null && !other.isDeleted() && !other.isNew()) throw new ObjectExistsException(_loc.get("cache-exists", obj.getClass().getName(), id)).setFailedObject(obj); } }
/** * This method makes sure we don't already have the instance cached */ protected void checkForDuplicateId(Object id, Object obj, ClassMetaData meta) { FieldMetaData[] pks = meta.getPrimaryKeyFields(); if (pks != null && pks.length == 1 && pks[0].getValueStrategy() == ValueStrategies.AUTOASSIGN) { return; } StateManagerImpl other = getStateManagerImplById(id, false); if (other != null && !other.isDeleted() && !other.isNew()) throw new ObjectExistsException(_loc.get("cache-exists", obj.getClass().getName(), id)).setFailedObject(obj); }
/** * This method makes sure we don't already have the instance cached */ protected void checkForDuplicateId(Object id, Object obj, ClassMetaData meta) { FieldMetaData[] pks = meta.getPrimaryKeyFields(); if (pks != null && pks.length == 1 && pks[0].getValueStrategy() == ValueStrategies.AUTOASSIGN) { return; } StateManagerImpl other = getStateManagerImplById(id, false); if (other != null && !other.isDeleted() && !other.isNew()) throw new ObjectExistsException(_loc.get("cache-exists", obj.getClass().getName(), id)).setFailedObject(obj); }
/** * This method makes sure we don't already have the instance cached */ protected void checkForDuplicateId(Object id, Object obj, ClassMetaData meta) { FieldMetaData[] pks = meta.getPrimaryKeyFields(); if (pks != null && pks.length == 1 && pks[0].getValueStrategy() == ValueStrategies.AUTOASSIGN) { return; } StateManagerImpl other = getStateManagerImplById(id, false); if (other != null && !other.isDeleted() && !other.isNew()) throw new ObjectExistsException(_loc.get("cache-exists", obj.getClass().getName(), id)).setFailedObject(obj); }
/** * This method makes sure we don't already have the instance cached */ protected void checkForDuplicateId(Object id, Object obj, ClassMetaData meta) { FieldMetaData[] pks = meta.getPrimaryKeyFields(); if (pks != null && pks.length == 1 && pks[0].getValueStrategy() == ValueStrategies.AUTOASSIGN) { return; } StateManagerImpl other = getStateManagerImplById(id, false); if (other != null && !other.isDeleted() && !other.isNew()) throw new ObjectExistsException(_loc.get("cache-exists", obj.getClass().getName(), id)).setFailedObject(obj); }
throw new ObjectExistsException(_loc.get ("persist-detached", Exceptions.toString(obj))). setFailedObject(obj); throw new ObjectExistsException(_loc.get ("persist-detached", Exceptions.toString(obj))). setFailedObject(obj);
if (sm.isDetached()) { throw new ObjectExistsException(_loc.get("persist-detached", Exceptions.toString(obj))) .setFailedObject(obj); if (pc.pcIsDetached() == Boolean.TRUE) { throw new ObjectExistsException(_loc.get("persist-detached", Exceptions.toString(obj))) .setFailedObject(obj);
if (sm.isDetached()) { throw new ObjectExistsException(_loc.get("persist-detached", Exceptions.toString(obj))) .setFailedObject(obj); if (pc.pcIsDetached() == Boolean.TRUE) { throw new ObjectExistsException(_loc.get("persist-detached", Exceptions.toString(obj))) .setFailedObject(obj);
if (sm.isDetached()) { throw new ObjectExistsException(_loc.get("persist-detached", Exceptions.toString(obj))) .setFailedObject(obj); if (pc.pcIsDetached() == Boolean.TRUE) { throw new ObjectExistsException(_loc.get("persist-detached", Exceptions.toString(obj))) .setFailedObject(obj);
if (sm.isDetached()) { throw new ObjectExistsException(_loc.get("persist-detached", Exceptions.toString(obj))) .setFailedObject(obj); if (pc.pcIsDetached() == Boolean.TRUE) { throw new ObjectExistsException(_loc.get("persist-detached", Exceptions.toString(obj))) .setFailedObject(obj);