agave-systems/systems-core/src/main/java/org/iplantc/service/transfer/dao/TransferTaskDao.java
/**
	 * Copy the state of the given object onto the persistent object with the same identifier. 
	 * If there is no persistent instance currently associated with the session, it will be loaded. 
	 * Return the persistent instance. If the given instance is unsaved, save a copy of and return 
	 * it as a newly persistent instance. The given instance does not become associated with the 
	 * session. This operation cascades to associated instances if the association is mapped with
	 * cascade="merge".
     *
	 * @param task
	 * @return
	 * @throws TransferException
	 */
Copy the state of the given object onto the persistent object with the same identifier.
If there is no persistent instance currently associated with the session, it will be loaded.
Return the persistent instance. If the given instance is unsaved, save a copy of and return
it as a newly persistent instance. The given instance does not become associated with the
session. This operation cascades to associated instances if the association is mapped with
cascade="merge".

@param task
@return
@throws TransferException
Copy the state of the given object onto the persistent object with the same identifier . If there is no persistent instance currently associated with the session it will be loaded . Return the persistent instance . If the given instance is unsaved save a copy of and return it as a newly persistent instance . The given instance does not become associated with the session . This operation cascades to associated instances if the association is mapped with cascade = " merge " . @param task @return @throws TransferException
public static TransferTask merge(TransferTask task) throws TransferException
	{
		if (task == null)
			throw new TransferException("TransferTask cannot be null");
		try
		{
			Session session = getSession();
			task.setLastUpdated(new Date());
			TransferTask mergedTask = (TransferTask)session.merge(task);
			session.flush();
			return mergedTask;
		}
		catch (StaleObjectStateException ex)
		{
			throw ex;
		}
		catch (HibernateException ex)
		{
			try
			{
				if (HibernateUtil.getSession().isOpen()) {
					HibernateUtil.rollbackTransaction();
				}
			}
			catch (Exception ignored) {}
			throw new TransferException("Failed to save transfer task", ex);
		}
		finally {
			try { HibernateUtil.commitTransaction(); } catch (Exception ignored) {}
		}
	}
public static TransferTask merge ( TransferTask task ) throws TransferException { if ( task == null ) throw new TransferException ( "TransferTask cannot be null" ) ; try { Session session = getSession ( ) ; task . setLastUpdated ( new Date ( ) ) ; TransferTask mergedTask = ( TransferTask ) session . merge ( task ) ; session . flush ( ) ; return mergedTask ; } catch ( StaleObjectStateException ex ) { throw ex ; } catch ( HibernateException ex ) { try { if ( HibernateUtil . getSession ( ) . isOpen ( ) ) { HibernateUtil . rollbackTransaction ( ) ; } } catch ( Exception ignored ) { } throw new TransferException ( "Failed to save transfer task" , ex ) ; } finally { try { HibernateUtil . commitTransaction ( ) ; } catch ( Exception ignored ) { } } }
Copy the state of the given object onto the persistent object with the same identifier.
Copy the state of the given object onto the persistent object with the same identifier .