Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * #%L
   * BroadleafCommerce Framework
   * %%
   * Copyright (C) 2009 - 2013 Broadleaf Commerce
   * %%
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
  * 
  *       http://www.apache.org/licenses/LICENSE-2.0
  * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  * #L%
  */
 package org.broadleafcommerce.core.payment.dao;
 
 
 import java.util.List;
 
 @Repository("blSecureOrderPaymentDao")
 public class SecureOrderPaymentDaoImpl implements SecureOrderPaymentDao {
 
     @PersistenceContext(unitName = "blSecurePU")
     protected EntityManager em;
 
     @Resource(name = "blEncryptionModule")
     protected EncryptionModule encryptionModule;
 
     @Resource(name = "blEntityConfiguration")
 
     public Referenced save(Referenced securePaymentInfo) {
         return .merge(securePaymentInfo);
     }
 
         BankAccountPayment response = (BankAccountPayment.createEntityInstance("org.broadleafcommerce.core.payment.domain.BankAccountPaymentInfo");
         response.setEncryptionModule();
         return response;
     }
 
         GiftCardPayment response = (GiftCardPayment.createEntityInstance("org.broadleafcommerce.core.payment.domain.GiftCardPaymentInfo");
         response.setEncryptionModule();
         return response;
     }
 
         CreditCardPayment response = (CreditCardPayment.createEntityInstance("org.broadleafcommerce.core.payment.domain.CreditCardPaymentInfo");
         response.setEncryptionModule();
         return response;
     }
 
     @SuppressWarnings("unchecked")
     public BankAccountPayment findBankAccountPayment(String referenceNumber) {
         Query query = .createNamedQuery("BC_READ_BANK_ACCOUNT_BY_REFERENCE_NUMBER");
         query.setParameter("referenceNumber"referenceNumber);
         List<BankAccountPaymentinfos = query.getResultList();
         BankAccountPayment response = (infos == null || infos.size() == 0) ? null : infos.get(0);
         if (response != null) {
             response.setEncryptionModule();
         }
         return response;
     }
 
     @SuppressWarnings("unchecked")
     public CreditCardPayment findCreditCardPayment(String referenceNumber) {
         Query query = .createNamedQuery("BC_READ_CREDIT_CARD_BY_REFERENCE_NUMBER");
         query.setParameter("referenceNumber"referenceNumber);
         List<CreditCardPaymentinfos = query.getResultList();
         CreditCardPayment response = (infos == null || infos.size() == 0) ? null : infos.get(0);
         if (response != null) {
             response.setEncryptionModule();
         }
         return response;
     }
 
     @SuppressWarnings("unchecked")
     public GiftCardPayment findGiftCardPayment(String referenceNumber) {
         Query query = .createNamedQuery("BC_READ_GIFT_CARD_BY_REFERENCE_NUMBER");
         query.setParameter("referenceNumber"referenceNumber);
         List<GiftCardPaymentinfos = query.getResultList();
         GiftCardPayment response = (infos == null || infos.size() == 0) ? null : infos.get(0);
        if (response != null) {
            response.setEncryptionModule();
        }
        return response;
    }
    public void delete(Referenced securePayment) {
        if (!.contains(securePayment)) {
            securePayment = .find(securePayment.getClass(), securePayment.getId());
        }
        .remove(securePayment);
    }
New to GrepCode? Check out our FAQ X