You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jb...@apache.org on 2008/06/30 23:08:01 UTC

svn commit: r672922 - in /geronimo/samples/branches/2.1/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-w...

Author: jbohn
Date: Mon Jun 30 14:08:01 2008
New Revision: 672922

URL: http://svn.apache.org/viewvc?rev=672922&view=rev
Log:
merge 672904 from trunk - 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/branches/2.1/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/CustomerInfo.java
      - copied unchanged from r672904, geronimo/samples/trunk/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/CustomerInfo.java
Removed:
    geronimo/samples/branches/2.1/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/Customer.java
Modified:
    geronimo/samples/branches/2.1/samples/customer-service/customer-service-ear/src/main/resources/CustomerService.sql
    geronimo/samples/branches/2.1/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionBean.java
    geronimo/samples/branches/2.1/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionLocal.java
    geronimo/samples/branches/2.1/samples/customer-service/customer-service-ejb/src/main/resources/META-INF/persistence.xml
    geronimo/samples/branches/2.1/samples/customer-service/customer-service-war/src/main/java/com/service/customer/web/CustomerServiceJavaBean.java
    geronimo/samples/branches/2.1/samples/customer-service/customer-service-war/src/main/webapp/customers/index.jsp

Modified: geronimo/samples/branches/2.1/samples/customer-service/customer-service-ear/src/main/resources/CustomerService.sql
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/customer-service/customer-service-ear/src/main/resources/CustomerService.sql?rev=672922&r1=672921&r2=672922&view=diff
==============================================================================
--- geronimo/samples/branches/2.1/samples/customer-service/customer-service-ear/src/main/resources/CustomerService.sql (original)
+++ geronimo/samples/branches/2.1/samples/customer-service/customer-service-ear/src/main/resources/CustomerService.sql Mon Jun 30 14:08:01 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');

Modified: geronimo/samples/branches/2.1/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionBean.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionBean.java?rev=672922&r1=672921&r2=672922&view=diff
==============================================================================
--- geronimo/samples/branches/2.1/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionBean.java (original)
+++ geronimo/samples/branches/2.1/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionBean.java Mon Jun 30 14:08:01 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/branches/2.1/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionLocal.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionLocal.java?rev=672922&r1=672921&r2=672922&view=diff
==============================================================================
--- geronimo/samples/branches/2.1/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionLocal.java (original)
+++ geronimo/samples/branches/2.1/samples/customer-service/customer-service-ejb/src/main/java/com/service/customer/ejb/ProcessCustomerSessionLocal.java Mon Jun 30 14:08:01 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/branches/2.1/samples/customer-service/customer-service-ejb/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/customer-service/customer-service-ejb/src/main/resources/META-INF/persistence.xml?rev=672922&r1=672921&r2=672922&view=diff
==============================================================================
--- geronimo/samples/branches/2.1/samples/customer-service/customer-service-ejb/src/main/resources/META-INF/persistence.xml (original)
+++ geronimo/samples/branches/2.1/samples/customer-service/customer-service-ejb/src/main/resources/META-INF/persistence.xml Mon Jun 30 14:08:01 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/branches/2.1/samples/customer-service/customer-service-war/src/main/java/com/service/customer/web/CustomerServiceJavaBean.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/customer-service/customer-service-war/src/main/java/com/service/customer/web/CustomerServiceJavaBean.java?rev=672922&r1=672921&r2=672922&view=diff
==============================================================================
--- geronimo/samples/branches/2.1/samples/customer-service/customer-service-war/src/main/java/com/service/customer/web/CustomerServiceJavaBean.java (original)
+++ geronimo/samples/branches/2.1/samples/customer-service/customer-service-war/src/main/java/com/service/customer/web/CustomerServiceJavaBean.java Mon Jun 30 14:08:01 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/branches/2.1/samples/customer-service/customer-service-war/src/main/webapp/customers/index.jsp
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/2.1/samples/customer-service/customer-service-war/src/main/webapp/customers/index.jsp?rev=672922&r1=672921&r2=672922&view=diff
==============================================================================
--- geronimo/samples/branches/2.1/samples/customer-service/customer-service-war/src/main/webapp/customers/index.jsp (original)
+++ geronimo/samples/branches/2.1/samples/customer-service/customer-service-war/src/main/webapp/customers/index.jsp Mon Jun 30 14:08:01 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() %>">