Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void handleDateChange(List<Long> dpIdList) {
- for(Long dpid : dpIdList) {
- updateFeeTransactionsForDateChange(dpid);
- deactivateFeeTransactionsAfterUpdate(dpid);
- }
- }
- public void updateFeeTransactionsForDateChange(final Long dealProductId) {
- List<FeeTransaction> feeTransactionList = feeTransactionDAO.getActiveUnmappedFeeTransactionEntitiesForDealProduct(dealProductId);
- for (FeeTransaction feeTransaction : feeTransactionList) {
- //Some Logic
- }
- }
- public void deactivateFeeTransactionsAfterUpdate(final Long dealProductId) {
- String UPDATE_ACTIVE_FOR_ALLOCATIONS = "update fee_transaction ft set ft.active = 'N' where ft.deal_product_id = ?1 and ft.active = 'Y'";
- entityManager.createNativeQuery(UPDATE_ACTIVE_FOR_ALLOCATIONS).setParameter(1, dealProduct.getDealProductId()).executeUpdate();
- }
- @Entity
- @Table(name = "FEE_TRANSACTION")
- @SequenceGenerator(name = "FEETRANSPK", sequenceName = "FEETRANSID_SEQ")
- @Named("feeTransaction")
- @NamedQueries({
- @NamedQuery(
- name = FeeTransaction.UPDATE_ACTIVE_FOR_FEE_TRANSACTIONS_BY_DEAL_PRODUCT_IDS,
- query = "update FeeTransaction set active = false where dealProductId in (:dealProductIds) and active = 'Y' ")
- })
- public class FeeTransaction implements Serializable {
- //Attributes, getters, and setters
- }
- public void updateActiveForVerbFeeTransactionsByFeeTransactionIds(Set<Long> dealProductIds) {
- entityManager.createNamedQuery(VerbFeeTransaction.UPDATE_ACTIVE_FOR_FEE_TRANSACTIONS_BY_DEAL_PRODUCT_IDS)
- .setParameter("dealProductIds", dealProductIds)
- .executeUpdate();
- }
- private void handleDateChange(List<Long> dpIdList) {
- for(Long dpid : dpIdList) {
- updateFeeTransactionsForDateChange(dpid);
- }
- feeTransactionDAO.updateActiveForVerbFeeTransactionsByFeeTransactionIds(dpIdList);
- }
Add Comment
Please, Sign In to add comment