/** * PUBLIC: * Update the object and all of its privately owned parts in the database. * Update should only be used if the application knows that the object is new, * otherwise writeObject should be used. * The update operation can be customized through using an update query. * * @exception DatabaseException if an error occurs on the database, * these include constraint violations, security violations and general database errors. * @exception OptimisticLockException if the object's descriptor is using optimistic locking and * the object has been updated or deleted by another user since it was last read. * * @see UpdateObjectQuery * @see #writeObject(Object) */ public Object updateObject(Object domainObject) throws DatabaseException, OptimisticLockException { UpdateObjectQuery query = new UpdateObjectQuery(); query.setObject(domainObject); query.setIsExecutionClone(true); return executeQuery(query); }
/** * PUBLIC: * Update the object and all of its privately owned parts in the database. * Update should only be used if the application knows that the object is new, * otherwise writeObject should be used. * The update operation can be customized through using an update query. * * @exception DatabaseException if an error occurs on the database, * these include constraint violations, security violations and general database errors. * @exception OptimisticLockException if the object's descriptor is using optimistic locking and * the object has been updated or deleted by another user since it was last read. * * @see UpdateObjectQuery * @see #writeObject(Object) */ public Object updateObject(Object domainObject) throws DatabaseException, OptimisticLockException { UpdateObjectQuery query = new UpdateObjectQuery(); query.setObject(domainObject); query.setIsExecutionClone(true); return executeQuery(query); }
/** * PUBLIC: * Update the object and all of its privately owned parts in the database. * Update should only be used if the application knows that the object is new, * otherwise writeObject should be used. * The update operation can be customized through using an update query. * * @exception DatabaseException if an error occurs on the database, * these include constraint violations, security violations and general database errors. * @exception OptimisticLockException if the object's descriptor is using optimistic locking and * the object has been updated or deleted by another user since it was last read. * * @see UpdateObjectQuery * @see #writeObject(Object) */ public Object updateObject(Object domainObject) throws DatabaseException, OptimisticLockException { UpdateObjectQuery query = new UpdateObjectQuery(); query.setObject(domainObject); query.setIsExecutionClone(true); return executeQuery(query); }
/** * INTERNAL: * An object is still in the collection, update it as it may have changed. */ protected void objectUnchangedDuringUpdate(ObjectLevelModifyQuery query, Object object, Hashtable backupCloneKeyedCache, CacheKey cachedKey) throws DatabaseException, OptimisticLockException { // Always write for updates, either private or in uow if calling this method. UpdateObjectQuery updateQuery = new UpdateObjectQuery(); updateQuery.setIsExecutionClone(true); Object backupclone = backupCloneKeyedCache.get(cachedKey); updateQuery.setBackupClone(backupclone); prepareModifyQueryForUpdate(query, updateQuery, object); query.getSession().executeQuery(updateQuery, updateQuery.getTranslationRow()); } protected void objectUnchangedDuringUpdate(ObjectLevelModifyQuery query, Object object, Object backupClone) throws DatabaseException, OptimisticLockException {
/** * INTERNAL: * An object is still in the collection, update it as it may have changed. */ @Override protected void objectUnchangedDuringUpdate(ObjectLevelModifyQuery query, Object object, Map backupCloneKeyedCache, Object cachedKey) throws DatabaseException, OptimisticLockException { // Always write for updates, either private or in uow if calling this method. UpdateObjectQuery updateQuery = new UpdateObjectQuery(); updateQuery.setIsExecutionClone(true); Object backupclone = backupCloneKeyedCache.get(cachedKey); updateQuery.setBackupClone(backupclone); prepareModifyQueryForUpdate(query, updateQuery, object); query.getSession().executeQuery(updateQuery, updateQuery.getTranslationRow()); }
/** * INTERNAL: * An object is still in the collection, update it as it may have changed. */ @Override protected void objectUnchangedDuringUpdate(ObjectLevelModifyQuery query, Object object, Map backupCloneKeyedCache, Object cachedKey) throws DatabaseException, OptimisticLockException { // Always write for updates, either private or in uow if calling this method. UpdateObjectQuery updateQuery = new UpdateObjectQuery(); updateQuery.setIsExecutionClone(true); Object backupclone = backupCloneKeyedCache.get(cachedKey); updateQuery.setBackupClone(backupclone); prepareModifyQueryForUpdate(query, updateQuery, object); query.getSession().executeQuery(updateQuery, updateQuery.getTranslationRow()); }
protected void objectUnchangedDuringUpdate(ObjectLevelModifyQuery query, Object object, Object backupClone) throws DatabaseException, OptimisticLockException { // Always write for updates, either private or in uow if calling this method. UpdateObjectQuery updateQuery = new UpdateObjectQuery(); updateQuery.setIsExecutionClone(true); updateQuery.setBackupClone(backupClone); prepareModifyQueryForUpdate(query, updateQuery, object); query.getSession().executeQuery(updateQuery, updateQuery.getTranslationRow()); }
protected void objectUnchangedDuringUpdate(ObjectLevelModifyQuery query, Object object, Object backupClone) throws DatabaseException, OptimisticLockException { // Always write for updates, either private or in uow if calling this method. UpdateObjectQuery updateQuery = new UpdateObjectQuery(); updateQuery.setIsExecutionClone(true); updateQuery.setBackupClone(backupClone); prepareModifyQueryForUpdate(query, updateQuery, object); query.getSession().executeQuery(updateQuery, updateQuery.getTranslationRow()); }
protected void objectUnchangedDuringUpdate(ObjectLevelModifyQuery query, Object object, Object backupClone) throws DatabaseException, OptimisticLockException { // Always write for updates, either private or in uow if calling this method. UpdateObjectQuery updateQuery = new UpdateObjectQuery(); updateQuery.setIsExecutionClone(true); updateQuery.setBackupClone(backupClone); prepareModifyQueryForUpdate(query, updateQuery, object); query.getSession().executeQuery(updateQuery, updateQuery.getTranslationRow()); }