IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.channel.smart.data.controller
Class PreferenceLogDAO

java.lang.Object
  extended by com.ibm.btt.channel.smart.data.controller.PreferenceLogDAO
All Implemented Interfaces:
IPreferenceLogDAO

public class PreferenceLogDAO
extends java.lang.Object
implements IPreferenceLogDAO

A data access object (DAO) providing persistence and search support for PreferenceLog entities. Transaction control of the save(), update() and delete() operations must be handled externally by senders of these methods or must be manually added to each of these methods for data to be persisted to the JPA datastore.

See Also:
com.ibm.btt.channel.smart.data.controller.PreferenceLog

Field Summary
static java.lang.String USER_ID
           
 
Constructor Summary
PreferenceLogDAO()
           
 
Method Summary
 void delete(PreferenceLog entity)
          Delete a persistent PreferenceLog entity.
 java.util.List<PreferenceLog> findAll(int... rowStartIdxAndCount)
          Find all PreferenceLog entities.
 PreferenceLog findById(java.lang.String id)
          find the PreferenceLog with id
 java.util.List<PreferenceLog> findByProperty(java.lang.String propertyName, java.lang.Object value, int... rowStartIdxAndCount)
          Find all PreferenceLog entities with a specific property value.
 java.util.List<PreferenceLog> findByUserId(java.lang.Object userId, int... rowStartIdxAndCount)
          Find all PreferenceLog entities with user id
 void save(PreferenceLog entity)
          Perform an initial save of a previously unsaved PreferenceLog entity.
 PreferenceLog update(PreferenceLog entity)
          Persist a previously saved PreferenceLog entity and return it or a copy of it to the sender.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_ID

public static final java.lang.String USER_ID
See Also:
Constant Field Values
Constructor Detail

PreferenceLogDAO

public PreferenceLogDAO()
Method Detail

save

public void save(PreferenceLog entity)
Perform an initial save of a previously unsaved PreferenceLog entity. All subsequent persist actions of this entity should use the #update() method. This operation must be performed within the a database transaction context for the entity's data to be permanently saved to the persistence store, i.e., database. This method uses the EntityManager#persist operation.
 EntityManagerHelper.beginTransaction();
 PreferenceLogDAO.save(entity);
 EntityManagerHelper.commit();
 

Specified by:
save in interface IPreferenceLogDAO
Parameters:
entity - PreferenceLog entity to persist
Throws:
java.lang.RuntimeException - when the operation fails

delete

public void delete(PreferenceLog entity)
Delete a persistent PreferenceLog entity. This operation must be performed within the a database transaction context for the entity's data to be permanently deleted from the persistence store, i.e., database. This method uses the EntityManager#delete operation.
 EntityManagerHelper.beginTransaction();
 PreferenceLogDAO.delete(entity);
 EntityManagerHelper.commit();
 entity = null;
 

Specified by:
delete in interface IPreferenceLogDAO
Parameters:
entity - PreferenceLog entity to delete
Throws:
java.lang.RuntimeException - when the operation fails

update

public PreferenceLog update(PreferenceLog entity)
Persist a previously saved PreferenceLog entity and return it or a copy of it to the sender. A copy of the PreferenceLog entity parameter is returned when the JPA persistence mechanism has not previously been tracking the updated entity. This operation must be performed within the a database transaction context for the entity's data to be permanently saved to the persistence store, i.e., database. This method uses the EntityManager#merge operation.
 EntityManagerHelper.beginTransaction();
 entity = PreferenceLogDAO.update(entity);
 EntityManagerHelper.commit();
 

Specified by:
update in interface IPreferenceLogDAO
Parameters:
entity - PreferenceLog entity to update
Returns:
PreferenceLog the persisted PreferenceLog entity instance, may not be the same
Throws:
java.lang.RuntimeException - if the operation fails

findById

public PreferenceLog findById(java.lang.String id)
find the PreferenceLog with id

Specified by:
findById in interface IPreferenceLogDAO
Parameters:
String - id
Returns:
PreferenceLog

findByProperty

public java.util.List<PreferenceLog> findByProperty(java.lang.String propertyName,
                                                    java.lang.Object value,
                                                    int... rowStartIdxAndCount)
Find all PreferenceLog entities with a specific property value.

Specified by:
findByProperty in interface IPreferenceLogDAO
Parameters:
propertyName - the name of the PreferenceLog property to query
value - the property value to match
rowStartIdxAndCount - Optional int varargs. rowStartIdxAndCount[0] specifies the the row index in the query result-set to begin collecting the results. rowStartIdxAndCount[1] specifies the the maximum number of results to return.
Returns:
List found by query

findByUserId

public java.util.List<PreferenceLog> findByUserId(java.lang.Object userId,
                                                  int... rowStartIdxAndCount)
Find all PreferenceLog entities with user id

Specified by:
findByUserId in interface IPreferenceLogDAO
Parameters:
Object - userId
int... - rowStartIdxAndCount
Returns:
List

findAll

public java.util.List<PreferenceLog> findAll(int... rowStartIdxAndCount)
Find all PreferenceLog entities.

Specified by:
findAll in interface IPreferenceLogDAO
Parameters:
rowStartIdxAndCount - Optional int varargs. rowStartIdxAndCount[0] specifies the the row index in the query result-set to begin collecting the results. rowStartIdxAndCount[1] specifies the the maximum count of results to return.
Returns:
List all PreferenceLog entities

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2010