svnno****@sourc*****
svnno****@sourc*****
2008年 1月 29日 (火) 06:55:49 JST
Revision: 801 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=801 Author: shinsuke Date: 2008-01-29 06:55:49 +0900 (Tue, 29 Jan 2008) Log Message: ----------- renamed PompeiDBException. Modified Paths: -------------- pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/CustomerService.java pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/OrderService.java pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/ProductService.java pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/impl/CustomerServiceImpl.java pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/impl/OrderServiceImpl.java pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/impl/ProductServiceImpl.java Added Paths: ----------- pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/PompeiDBConstants.java pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/PompeiDBException.java Removed Paths: ------------- pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/PompeiException.java -------------- next part -------------- Added: pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/PompeiDBConstants.java =================================================================== --- pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/PompeiDBConstants.java 2008-01-28 05:13:25 UTC (rev 800) +++ pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/PompeiDBConstants.java 2008-01-28 21:55:49 UTC (rev 801) @@ -0,0 +1,11 @@ +package jp.sf.pal.pompei; + +import java.math.BigDecimal; + +public class PompeiDBConstants { + public static final String DEFAULT_LANGUAGE = "DEFAULT"; + + public static final BigDecimal TRUE = BigDecimal.ONE; + + public static final BigDecimal FALSE = BigDecimal.ZERO; +} Property changes on: pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/PompeiDBConstants.java ___________________________________________________________________ Name: svn:eol-style + native Copied: pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/PompeiDBException.java (from rev 800, pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/PompeiException.java) =================================================================== --- pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/PompeiException.java 2008-01-28 05:13:25 UTC (rev 800) +++ pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/PompeiDBException.java 2008-01-28 21:55:49 UTC (rev 801) @@ -0,0 +1,93 @@ +package jp.sf.pal.pompei; + +/** + * @author shinsuke + * + */ +public class PompeiDBException extends Exception { + + /** + * Serial Version UID + */ + private static final long serialVersionUID = 4564000116499132363L; + + private String messageId; + + private Object[] args; + + /** + * @return Returns the messageId. + */ + public String getMessageId() { + return messageId; + } + + /** + * @param messageId + * The messageId to set. + */ + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + /** + * @return Returns the args. + */ + public Object[] getArgs() { + return args; + } + + /** + * @param args + * The args to set. + */ + public void setArgs(Object[] args) { + this.args = args; + } + + public PompeiDBException(String messageId) { + super(messageId); + this.messageId = messageId; + } + + public PompeiDBException(String messageId, Object[] args) { + super(messageId); + this.messageId = messageId; + this.args = args; + } + + public PompeiDBException(String messageId, String message, Throwable cause) { + super(message, cause); + this.messageId = messageId; + } + + public PompeiDBException(String messageId, Object[] args, String message, + Throwable cause) { + super(message, cause); + this.messageId = messageId; + this.args = args; + } + + public PompeiDBException(String messageId, String message) { + super(message); + this.messageId = messageId; + } + + public PompeiDBException(String messageId, Object[] args, String message) { + super(message); + this.messageId = messageId; + this.args = args; + } + + public PompeiDBException(String messageId, Throwable cause) { + super(cause); + this.messageId = messageId; + } + + public PompeiDBException(String messageId, Object[] args, Throwable cause) { + super(cause); + this.messageId = messageId; + this.args = args; + } + +} Deleted: pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/PompeiException.java =================================================================== --- pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/PompeiException.java 2008-01-28 05:13:25 UTC (rev 800) +++ pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/PompeiException.java 2008-01-28 21:55:49 UTC (rev 801) @@ -1,93 +0,0 @@ -package jp.sf.pal.pompei; - -/** - * @author shinsuke - * - */ -public class PompeiException extends Exception { - - /** - * Serial Version UID - */ - private static final long serialVersionUID = 4564000116499132363L; - - private String messageId; - - private Object[] args; - - /** - * @return Returns the messageId. - */ - public String getMessageId() { - return messageId; - } - - /** - * @param messageId - * The messageId to set. - */ - public void setMessageId(String messageId) { - this.messageId = messageId; - } - - /** - * @return Returns the args. - */ - public Object[] getArgs() { - return args; - } - - /** - * @param args - * The args to set. - */ - public void setArgs(Object[] args) { - this.args = args; - } - - public PompeiException(String messageId) { - super(messageId); - this.messageId = messageId; - } - - public PompeiException(String messageId, Object[] args) { - super(messageId); - this.messageId = messageId; - this.args = args; - } - - public PompeiException(String messageId, String message, Throwable cause) { - super(message, cause); - this.messageId = messageId; - } - - public PompeiException(String messageId, Object[] args, String message, - Throwable cause) { - super(message, cause); - this.messageId = messageId; - this.args = args; - } - - public PompeiException(String messageId, String message) { - super(message); - this.messageId = messageId; - } - - public PompeiException(String messageId, Object[] args, String message) { - super(message); - this.messageId = messageId; - this.args = args; - } - - public PompeiException(String messageId, Throwable cause) { - super(cause); - this.messageId = messageId; - } - - public PompeiException(String messageId, Object[] args, Throwable cause) { - super(cause); - this.messageId = messageId; - this.args = args; - } - -} Modified: pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/CustomerService.java =================================================================== --- pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/CustomerService.java 2008-01-28 05:13:25 UTC (rev 800) +++ pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/CustomerService.java 2008-01-28 21:55:49 UTC (rev 801) @@ -5,7 +5,7 @@ import java.util.List; import java.util.Map; -import jp.sf.pal.pompei.PompeiException; +import jp.sf.pal.pompei.PompeiDBException; import jp.sf.pal.pompei.exentity.AddressBook; import jp.sf.pal.pompei.exentity.Basket; import jp.sf.pal.pompei.exentity.Customer; @@ -32,7 +32,7 @@ public void addCustomer(Customer customers, AddressBook addressBook); public void addCustomer(Map<String, String> userInfo, Customer customers, - AddressBook addressBook) throws PompeiException; + AddressBook addressBook) throws PompeiDBException; public Customer getCustomerByPortalId(String portalId); Modified: pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/OrderService.java =================================================================== --- pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/OrderService.java 2008-01-28 05:13:25 UTC (rev 800) +++ pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/OrderService.java 2008-01-28 21:55:49 UTC (rev 801) @@ -5,7 +5,7 @@ import java.util.Currency; import java.util.List; -import jp.sf.pal.pompei.PompeiException; +import jp.sf.pal.pompei.PompeiDBException; import jp.sf.pal.pompei.allcommon.cbean.PagingResultBean; import jp.sf.pal.pompei.exentity.AddressBook; import jp.sf.pal.pompei.exentity.CardTypeDescription; @@ -43,7 +43,7 @@ DeliveryMethod deliveryMethod, OrderCardInfo orderCardInfo, Currency currency, BigDecimal subTotalPrice, BigDecimal tax, BigDecimal deliveryPrice, BigDecimal paymentFee, - BigDecimal totalPrice) throws PompeiException; + BigDecimal totalPrice) throws PompeiDBException; public Currency getCurrency(BigDecimal currencyId); @@ -63,7 +63,7 @@ BigDecimal orderFormId); public void sendOrderNotifications(BigDecimal orderFormId, - BigDecimal[] orderNotificationIds) throws PompeiException; + BigDecimal[] orderNotificationIds) throws PompeiDBException; public OrderNotification getOrderNotification(BigDecimal orderNotificationId); Modified: pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/ProductService.java =================================================================== --- pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/ProductService.java 2008-01-28 05:13:25 UTC (rev 800) +++ pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/ProductService.java 2008-01-28 21:55:49 UTC (rev 801) @@ -4,7 +4,7 @@ import java.math.BigDecimal; import java.util.List; -import jp.sf.pal.pompei.PompeiException; +import jp.sf.pal.pompei.PompeiDBException; import jp.sf.pal.pompei.allcommon.cbean.PagingResultBean; import jp.sf.pal.pompei.exentity.CategoryDescription; import jp.sf.pal.pompei.exentity.Manufacturer; @@ -16,7 +16,7 @@ public interface ProductService extends Serializable { // NOTE: from an old ProductService - BEGIN public void addProductDescription(ProductDescription description, - BigDecimal categoryId) throws PompeiException; + BigDecimal categoryId) throws PompeiDBException; public void deleteProduct(BigDecimal productsId); @@ -33,7 +33,7 @@ ProductPager productPager); public void updateProductDescription(ProductDescription description) - throws PompeiException; + throws PompeiDBException; public Manufacturer getManufacturer(BigDecimal manufacturersId); Modified: pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/impl/CustomerServiceImpl.java =================================================================== --- pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/impl/CustomerServiceImpl.java 2008-01-28 05:13:25 UTC (rev 800) +++ pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/impl/CustomerServiceImpl.java 2008-01-28 21:55:49 UTC (rev 801) @@ -4,8 +4,10 @@ import java.util.List; import java.util.Map; -import jp.sf.pal.pompei.PompeiException; +import jp.sf.pal.pompei.PompeiDBConstants; +import jp.sf.pal.pompei.PompeiDBException; import jp.sf.pal.pompei.cbean.CustomerCB; +import jp.sf.pal.pompei.exbhv.AddressBookBhv; import jp.sf.pal.pompei.exbhv.CustomerBhv; import jp.sf.pal.pompei.exentity.AddressBook; import jp.sf.pal.pompei.exentity.Basket; @@ -18,6 +20,8 @@ private CustomerBhv customerBhv; + private AddressBookBhv addressBookBhv; + public List<Customer> getCustomerList() { CustomerCB customerCB = new CustomerCB(); customerCB.query().addOrderBy_LastnameDescription_Asc(); @@ -27,8 +31,7 @@ } public void addAddressBook(AddressBook addressBook) { - // TODO Auto-generated method stub - + getAddressBookBhv().insert(addressBook); } public void addBasket(Basket customerBaskets) { @@ -36,13 +39,18 @@ } - public void addCustomer(Customer customers, AddressBook addressBook) { - // TODO Auto-generated method stub - + public void addCustomer(Customer customer, AddressBook addressBook) { + // needs to set portalId for customer before calling this method. + // needs to set deliveryZone for addressBook before calling this method. + // needs to set country for addressBook before calling this method. + getCustomerBhv().insert(customer); + addressBook.setCustomerId(customer.getCustomerId()); + addressBook.setDefaultAddress(PompeiDBConstants.TRUE); + getAddressBookBhv().insert(addressBook); } public void addCustomer(Map<String, String> userInfo, Customer customers, - AddressBook addressBook) throws PompeiException { + AddressBook addressBook) throws PompeiDBException { // TODO Auto-generated method stub } @@ -53,8 +61,7 @@ } public void deleteAddressBook(AddressBook addressBook) { - // TODO Auto-generated method stub - + getAddressBookBhv().delete(addressBook); } public void deleteBasket(BigDecimal customerBasketId) { @@ -119,4 +126,12 @@ public void setCustomerBhv(CustomerBhv customerBhv) { this.customerBhv = customerBhv; } + + public AddressBookBhv getAddressBookBhv() { + return addressBookBhv; + } + + public void setAddressBookBhv(AddressBookBhv addressBookBhv) { + this.addressBookBhv = addressBookBhv; + } } Modified: pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/impl/OrderServiceImpl.java =================================================================== --- pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/impl/OrderServiceImpl.java 2008-01-28 05:13:25 UTC (rev 800) +++ pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/impl/OrderServiceImpl.java 2008-01-28 21:55:49 UTC (rev 801) @@ -4,7 +4,7 @@ import java.util.Currency; import java.util.List; -import jp.sf.pal.pompei.PompeiException; +import jp.sf.pal.pompei.PompeiDBException; import jp.sf.pal.pompei.allcommon.cbean.PagingResultBean; import jp.sf.pal.pompei.exentity.AddressBook; import jp.sf.pal.pompei.exentity.CardTypeDescription; @@ -38,7 +38,7 @@ DeliveryMethod deliveryMethod, OrderCardInfo orderCardInfo, Currency currency, BigDecimal subTotalPrice, BigDecimal tax, BigDecimal deliveryPrice, BigDecimal paymentFee, - BigDecimal totalPrice) throws PompeiException { + BigDecimal totalPrice) throws PompeiDBException { // TODO Auto-generated method stub return null; } @@ -140,7 +140,7 @@ } public void sendOrderNotifications(BigDecimal orderFormId, - BigDecimal[] orderNotificationIds) throws PompeiException { + BigDecimal[] orderNotificationIds) throws PompeiDBException { // TODO Auto-generated method stub } Modified: pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/impl/ProductServiceImpl.java =================================================================== --- pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/impl/ProductServiceImpl.java 2008-01-28 05:13:25 UTC (rev 800) +++ pompei/libraries/pompei-db/trunk/src/main/java/jp/sf/pal/pompei/service/impl/ProductServiceImpl.java 2008-01-28 21:55:49 UTC (rev 801) @@ -3,7 +3,7 @@ import java.math.BigDecimal; import java.util.List; -import jp.sf.pal.pompei.PompeiException; +import jp.sf.pal.pompei.PompeiDBException; import jp.sf.pal.pompei.allcommon.cbean.PagingResultBean; import jp.sf.pal.pompei.exentity.CategoryDescription; import jp.sf.pal.pompei.exentity.Manufacturer; @@ -28,7 +28,7 @@ } public void addProductDescription(ProductDescription description, - BigDecimal categoryId) throws PompeiException { + BigDecimal categoryId) throws PompeiDBException { // TODO Auto-generated method stub } @@ -156,7 +156,7 @@ } public void updateProductDescription(ProductDescription description) - throws PompeiException { + throws PompeiDBException { // TODO Auto-generated method stub }