org.apache.oozie.executor.jpa
Class BulkUpdateDeleteJPAExecutor

java.lang.Object
  extended by org.apache.oozie.executor.jpa.BulkUpdateDeleteJPAExecutor
All Implemented Interfaces:
JPAExecutor<Void>

public class BulkUpdateDeleteJPAExecutor
extends Object
implements JPAExecutor<Void>

Class for updating and deleting beans in bulk


Constructor Summary
BulkUpdateDeleteJPAExecutor()
           
BulkUpdateDeleteJPAExecutor(Collection<JsonBean> updateList, Collection<JsonBean> deleteList, boolean forRerun)
          Initialize the JPAExecutor using the update and delete list of JSON beans
 
Method Summary
 Void execute(javax.persistence.EntityManager em)
          Method that encapsulates JPA access operations.
 String getName()
          Return the name of the JPA executor.
 void setDeleteList(Collection<JsonBean> deleteList)
          Sets the delete list for JSON bean
 void setForRerun(boolean forRerun)
          Sets whether for RerunX command or no.
 void setUpdateList(Collection<JsonBean> updateList)
          Sets the update list for JSON bean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BulkUpdateDeleteJPAExecutor

public BulkUpdateDeleteJPAExecutor(Collection<JsonBean> updateList,
                                   Collection<JsonBean> deleteList,
                                   boolean forRerun)
Initialize the JPAExecutor using the update and delete list of JSON beans

Parameters:
deleteList -
updateList -

BulkUpdateDeleteJPAExecutor

public BulkUpdateDeleteJPAExecutor()
Method Detail

setUpdateList

public void setUpdateList(Collection<JsonBean> updateList)
Sets the update list for JSON bean

Parameters:
updateList -

setDeleteList

public void setDeleteList(Collection<JsonBean> deleteList)
Sets the delete list for JSON bean

Parameters:
deleteList -

setForRerun

public void setForRerun(boolean forRerun)
Sets whether for RerunX command or no. Else it'd be for ChangeX

Parameters:
forRerun -

getName

public String getName()
Description copied from interface: JPAExecutor
Return the name of the JPA executor. Used for logging and instrumentation.

Specified by:
getName in interface JPAExecutor<Void>
Returns:
the name of the JPA executor.

execute

public Void execute(javax.persistence.EntityManager em)
             throws JPAExecutorException
Description copied from interface: JPAExecutor
Method that encapsulates JPA access operations.

Implementations should not close the received EntityManager.

Implementations should commit any transaction before ending, else the transaction will be rolled back.

Specified by:
execute in interface JPAExecutor<Void>
Parameters:
em - an active EntityManager
Returns:
a return value if any.
Throws:
JPAExecutorException - thrown if a jpa executor failed


Copyright © 2012 Apache Software Foundation. All Rights Reserved.