geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jb...@apache.org
Subject svn commit: r672904 - in /geronimo/samples/trunk/samples/customer-service: customer-service-ear/src/main/resources/ customer-service-ejb/src/main/java/com/service/customer/ejb/ customer-service-ejb/src/main/resources/META-INF/ customer-service-war/src/...
Date Mon, 30 Jun 2008 20:41:44 GMT
Author: jbohn
Date: Mon Jun 30 13:41:44 2008
New Revision: 672904

URL: http://svn.apache.org/viewvc?rev=672904&view=rev
Log:
update customer-service sample to use a unique table name for customer so that it does not
conflict with the bank sample

Added:
    geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/CustomerInfo.java
      - copied, changed from r671554, geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/Customer.java
Removed:
    geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/Customer.java
Modified:
    geronimo/samples/trunk/samples/customer-service/customer-service-ear/src/main/resources/CustomerService.sql
    geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionBean.java
    geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionLocal.java
    geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/resources/META-INF/persistence.xml
    geronimo/samples/trunk/samples/customer-service/customer-service-war/src/main/java/com/service/customer/web/CustomerServiceJavaBean.java
    geronimo/samples/trunk/samples/customer-service/customer-service-war/src/main/webapp/customers/index.jsp

Modified: geronimo/samples/trunk/samples/customer-service/customer-service-ear/src/main/resources/CustomerService.sql
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/customer-service/customer-service-ear/src/main/resources/CustomerService.sql?rev=672904&r1=672903&r2=672904&view=diff
==============================================================================
--- geronimo/samples/trunk/samples/customer-service/customer-service-ear/src/main/resources/CustomerService.sql
(original)
+++ geronimo/samples/trunk/samples/customer-service/customer-service-ear/src/main/resources/CustomerService.sql
Mon Jun 30 13:41:44 2008
@@ -15,12 +15,12 @@
 --  limitations under the License.
 
 
-CREATE TABLE customer(
+CREATE TABLE customerInfo(
    customerid VARCHAR(10) PRIMARY KEY,
    fullname VARCHAR(30),
    emailaddress VARCHAR(30),
    interests VARCHAR(100)
 );
 
-INSERT INTO customer VALUES ('A100','John Doe10','Doe10@work.com','Java,Open Source, Computer
Graphics');
-INSERT INTO customer VALUES ('b100','Jane Doe20','Doe20@home.net','Budget Travel, New Zealand,
Martial Arts');
+INSERT INTO customerInfo VALUES ('A100','John Doe10','Doe10@work.com','Java,Open Source,
Computer Graphics');
+INSERT INTO customerInfo VALUES ('b100','Jane Doe20','Doe20@home.net','Budget Travel, New
Zealand, Martial Arts');

Copied: geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/CustomerInfo.java
(from r671554, geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/Customer.java)
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/CustomerInfo.java?p2=geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/CustomerInfo.java&p1=geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/Customer.java&r1=671554&r2=672904&rev=672904&view=diff
==============================================================================
--- geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/Customer.java
(original)
+++ geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/CustomerInfo.java
Mon Jun 30 13:41:44 2008
@@ -26,21 +26,21 @@
 import javax.persistence.Table;
 
 @Entity
-@Table(name = "customer")
-@NamedQueries({@NamedQuery(name = "AllCustomers", query = "SELECT c from Customer c"),
-        @NamedQuery(name = "FindCustomer", query = "SELECT c from Customer c  WHERE c.customerId=:customerId")})
-public class Customer implements Serializable {
+@Table(name = "CustomerInfo")
+@NamedQueries({@NamedQuery(name = "AllCustomers", query = "SELECT c from CustomerInfo c"),
+        @NamedQuery(name = "FindCustomer", query = "SELECT c from CustomerInfo c  WHERE c.customerId=:customerId")})
+public class CustomerInfo implements Serializable {
     private String customerId;
     private String fullName;
     private String emailAddress;
     private String interests;
 
-    public Customer() {
+    public CustomerInfo() {
 
     }
 
-    public Customer(String customerId, String fullName, String emailAddress,
-                    String interests) {
+    public CustomerInfo(String customerId, String fullName, String emailAddress,
+                        String interests) {
         this.customerId = customerId;
         this.fullName = fullName;
         this.emailAddress = emailAddress;
@@ -79,4 +79,4 @@
     public void setInterests(String interests) {
         this.interests = interests;
     }
-} // end Customer
+} // end CustomerInfo

Modified: geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionBean.java
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionBean.java?rev=672904&r1=672903&r2=672904&view=diff
==============================================================================
--- geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionBean.java
(original)
+++ geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionBean.java
Mon Jun 30 13:41:44 2008
@@ -33,16 +33,16 @@
 
     }
 
-    public List<Customer> findAllCustomers() {
+    public List<CustomerInfo> findAllCustomers() {
         Query q = em.createNamedQuery("AllCustomers");
-        List<Customer> customerList = q.getResultList();
+        List<CustomerInfo> customerList = q.getResultList();
         return customerList;
     }
 
-    public Customer findCustomer(String key) {
+    public CustomerInfo findCustomer(String key) {
         Query q = em.createNamedQuery("FindCustomer");
         q.setParameter("customerId", key);
-        Customer c = (Customer) q.getSingleResult();
+        CustomerInfo c = (CustomerInfo) q.getSingleResult();
         return c;
     }
 }

Modified: geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionLocal.java
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionLocal.java?rev=672904&r1=672903&r2=672904&view=diff
==============================================================================
--- geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionLocal.java
(original)
+++ geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionLocal.java
Mon Jun 30 13:41:44 2008
@@ -18,7 +18,7 @@
 package com.service.customer.ejb;
 
 public interface ProcessCustomerSessionLocal {
-    public java.util.List<Customer> findAllCustomers();
+    public java.util.List<CustomerInfo> findAllCustomers();
 
-    public Customer findCustomer(String key);
+    public CustomerInfo findCustomer(String key);
 }

Modified: geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/resources/META-INF/persistence.xml?rev=672904&r1=672903&r2=672904&view=diff
==============================================================================
--- geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/resources/META-INF/persistence.xml
(original)
+++ geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/resources/META-INF/persistence.xml
Mon Jun 30 13:41:44 2008
@@ -21,11 +21,11 @@
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"
              xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
     <persistence-unit name="CustomerPU">
-        <description>Entity Beans for Customer</description>
+        <description>Entity Beans for CustomerInfo</description>
         <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
         <jta-data-source>SampleTxDatasource</jta-data-source>
         <non-jta-data-source>SampleNoTxDatasource</non-jta-data-source>
-        <class>com.service.customer.ejb.Customer</class>
+        <class>com.service.customer.ejb.CustomerInfo</class>
         <properties>
             <property name="openjpa.jdbc.SynchronizeMappings" value="false"/>
         </properties>

Modified: geronimo/samples/trunk/samples/customer-service/customer-service-war/src/main/java/com/service/customer/web/CustomerServiceJavaBean.java
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/customer-service/customer-service-war/src/main/java/com/service/customer/web/CustomerServiceJavaBean.java?rev=672904&r1=672903&r2=672904&view=diff
==============================================================================
--- geronimo/samples/trunk/samples/customer-service/customer-service-war/src/main/java/com/service/customer/web/CustomerServiceJavaBean.java
(original)
+++ geronimo/samples/trunk/samples/customer-service/customer-service-war/src/main/java/com/service/customer/web/CustomerServiceJavaBean.java
Mon Jun 30 13:41:44 2008
@@ -21,7 +21,7 @@
 
 import javax.naming.InitialContext;
 
-import com.service.customer.ejb.Customer;
+import com.service.customer.ejb.CustomerInfo;
 import com.service.customer.ejb.ProcessCustomerSessionLocal;
 
 public class CustomerServiceJavaBean {
@@ -40,8 +40,8 @@
     }
 
 
-    public List<Customer> getAllCustomers() {
-        List<Customer> customerList = null;
+    public List<CustomerInfo> getAllCustomers() {
+        List<CustomerInfo> customerList = null;
 
         try {
             customerList = process.findAllCustomers();

Modified: geronimo/samples/trunk/samples/customer-service/customer-service-war/src/main/webapp/customers/index.jsp
URL: http://svn.apache.org/viewvc/geronimo/samples/trunk/samples/customer-service/customer-service-war/src/main/webapp/customers/index.jsp?rev=672904&r1=672903&r2=672904&view=diff
==============================================================================
--- geronimo/samples/trunk/samples/customer-service/customer-service-war/src/main/webapp/customers/index.jsp
(original)
+++ geronimo/samples/trunk/samples/customer-service/customer-service-war/src/main/webapp/customers/index.jsp
Mon Jun 30 13:41:44 2008
@@ -17,19 +17,19 @@
 under the License.
 -->
 <%
-    // index.jsp - Edit customer information no this page
+    // index.jsp - Edit customer information on this page
 %>
 
 <%@ page import="java.util.List" %>
-<%@ page import="com.service.customer.ejb.Customer" %>
+<%@ page import="com.service.customer.ejb.CustomerInfo" %>
 
 <jsp:useBean id="serviceBean" scope="session" class="com.service.customer.web.CustomerServiceJavaBean"/>
 <jsp:setProperty name="serviceBean" property="*"/>
 
 <HTML>
-<%! Customer customer = null; %>
+<%! CustomerInfo customer = null; %>
 <%! String message = null; %>
-<%! List<Customer> customerList = null; %>
+<%! List<CustomerInfo> customerList = null; %>
 
 <% message = ""; %>
 <% customerList = serviceBean.getAllCustomers(); %>
@@ -73,7 +73,7 @@
     <% if (customerList != null) { %>
     <% for (int x = 0; x < customerList.size(); x++) { %>
     <TR>
-        <% customer = (Customer) customerList.get(x); %>
+        <% customer = (CustomerInfo) customerList.get(x); %>
 
         <TD align="left">
             <INPUT type="radio" name="customerID" value="<%= customer.getCustomerId()
%>">



Mime
View raw message