📄 pojopricingbiz.java
字号:
package tarena.netctoss.biz;
import java.util.*;
import tarena.netctoss.dao.*;
import tarena.netctoss.exception.*;
import tarena.netctoss.model.*;
public class POJOPricingBIZ implements PricingBIZ {
private PricingDAO pricingDAO;
/**
* addPricing
*
* @param pricing Tpricing
* @throws InfrastructureException
* @throws RepeatBaseFeeAndRateFeeException
* @todo Implement this tarena.netctoss.biz.PricingBIZ method
*/
public void addPricing(Tpricing pricing) throws InfrastructureException,
RepeatBaseFeeAndRateFeeException {
if(pricing == null)
return;
boolean flag = pricingDAO.selectPricingByBaseFeeAndRateFee(pricing.getBaseFee(),pricing.getRateFee());
if(flag){
throw new RepeatBaseFeeAndRateFeeException("base and rate is repeat");
}else{
pricingDAO.insertPricing(pricing);
}
}
/**
* getPricingById
*
* @param pricingId Long
* @return Tpricing
* @throws InfrastructureException
* @todo Implement this tarena.netctoss.biz.PricingBIZ method
*/
public Tpricing getPricingById(Long pricingId) throws
InfrastructureException {
if(pricingId == null)
return null;
Tpricing pricing = pricingDAO.selectPricingById(pricingId);
return pricing;
}
/**
* listAllPricing
*
* @return Collection
* @throws InfrastructureException
* @todo Implement this tarena.netctoss.biz.PricingBIZ method
*/
public Collection listAllPricing() throws InfrastructureException {
Collection pricings = pricingDAO.selectAllPricing();
return pricings;
}
/**
* modifyPricing
*
* @param pricing Tpricing
* @throws InfrastructureException
* @throws RepeatBaseFeeAndRateFeeException
* @todo Implement this tarena.netctoss.biz.PricingBIZ method
*/
public void modifyPricing(Tpricing pricing) throws InfrastructureException,
RepeatBaseFeeAndRateFeeException {
if(pricing == null)
return ;
boolean flag = pricingDAO.selectPricingByBaseFeeAndRateFee(pricing.getBaseFee(),pricing.getRateFee());
if(flag)
throw new RepeatBaseFeeAndRateFeeException("base and rate fee repeat");
else
pricingDAO.updatePricing(pricing);
}
/**
* removePricing
*
* @param pricingId Long[]
* @throws InfrastructureException
* @todo Implement this tarena.netctoss.biz.PricingBIZ method
*/
public void removePricing(Long[] pricingId) throws InfrastructureException {
if(pricingId == null || pricingId.length==0)
return;
pricingDAO.deletePricings(pricingId);
}
public PricingDAO getPricingDAO() {
return pricingDAO;
}
public void setPricingDAO(PricingDAO pricingDAO) {
this.pricingDAO = pricingDAO;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -