geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r1041298 [2/2] - in /geronimo/server/trunk/testsuite/javaee6-testsuite: ./ jpa2.0-test/ jpa2.0-test/src/ jpa2.0-test/src/main/ jpa2.0-test/src/main/java/ jpa2.0-test/src/main/java/org/ jpa2.0-test/src/main/java/org/apache/ jpa2.0-test/src/m...
Date Thu, 02 Dec 2010 07:53:11 GMT
Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewStudents.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewStudents.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewStudents.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewStudents.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,82 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+
+package org.apache.geronimo.javaee6.jpa20.action;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import javax.ejb.EJB;
+import org.apache.geronimo.javaee6.jpa20.entities.Student;
+import org.apache.geronimo.javaee6.jpa20.entities.Course;
+import org.apache.geronimo.javaee6.jpa20.bean.Facade;
+@WebServlet(name="viewStudents", urlPatterns={"/viewStudents"})
+public class viewStudents extends HttpServlet {
+    @EJB
+    private Facade facade = null;
+    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+    	response.setContentType("text/html;charset=8859_1");
+        PrintWriter out = response.getWriter();
+        try {
+            out.println("<html>");
+            out.println("<head>");
+            out.println("<title>Servlet viewCourses</title>");
+            out.println("</head>");
+            out.println("<body>");
+            out.println("<table><tr><td>Student Name</td><td>Address</td><td>Telephone</td>"+
+                    "<td>Age</td><td>Rank</td></tr>");
+            List<Student> students = facade.findAllStudent();
+            for (Student student : students){
+                out.println("<tr><td>"+student.getInfo().getName()+"</td>");
+                out.println("<td>Country:"+student.getInfo().getAddress().getCountry()+"<br>City:"+
+                        student.getInfo().getAddress().getCity()+"<br>Street:"+
+                        student.getInfo().getAddress().getStreet()+"</td>");
+                out.println("<td>"+student.getInfo().getTelephone()+"</td><td>"+student.getInfo().getAge()+"</td>");
+                out.println("<td>"+student.getRank()+"</td>");
+                out.println(" </tr>");
+            }
+            out.println("</table>");
+            out.println("</body>");
+            out.println("</html>");
+
+        } finally {
+            out.close();
+        }
+    }
+
+    @Override
+    protected void doGet(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        processRequest(request, response);
+    }
+
+    @Override
+    protected void doPost(HttpServletRequest request, HttpServletResponse response)
+    throws ServletException, IOException {
+        processRequest(request, response);
+    }
+
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewStudents.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewStudents.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/action/viewStudents.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/bean/Facade.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/bean/Facade.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/bean/Facade.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/bean/Facade.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,202 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+
+package org.apache.geronimo.javaee6.jpa20.bean;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.Query;
+import javax.persistence.TypedQuery;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Root;
+import org.apache.geronimo.javaee6.jpa20.entities.*;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Join;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.Path;
+import javax.persistence.criteria.ListJoin;
+import javax.ejb.TransactionAttributeType;
+import javax.ejb.TransactionAttribute;
+
+import javax.ejb.Stateless;
+import javax.ejb.Stateful;
+
+@Stateful
+//@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
+public class Facade {
+
+    @PersistenceContext(unitName = "CourseSelectPU")
+    private EntityManager em;
+
+    public void createCourse(Course course) {
+//    System.out.println("in Facade.createCourse, cname is:"+course.getCname());
+    if (em==null || em.equals(null))
+    {
+    System.out.println("em is null");
+    return;
+    }
+//        em.getTransaction().begin();
+        em.persist(course);
+//        em.getTransaction().commit();
+
+    }
+
+    public void editCourse(Course course) {
+//        em.getTransaction().begin();
+        em.merge(course);
+//        em.getTransaction().commit();
+    }
+
+    public void removeCourse(Course course) {
+//        em.getTransaction().begin();
+        em.remove(em.merge(course));
+//        em.getTransaction().commit();
+    }
+
+
+    public void addComment(int cid, String comment) {
+        Course course=findCourse(cid);
+//        System.out.println("course_ID is :"+cid);
+        List<String> evaluations=course.getEvaluation();
+        
+        evaluations.add(comment);
+        course.setEvaluation(evaluations);
+        editCourse(course);
+    }
+
+        public void selectCourse(Student student, Course course) {
+            List<Course> map = new ArrayList<Course>();
+			if(student.getCourses()!=null){
+			    map = student.getCourses();
+			}
+            map.add(course);
+            student.setCourses(map);
+//            double totalScore = student.getTotalScore() + score;
+//            student.setTotalScore(totalScore);
+//            em.getTransaction().begin();
+            em.merge(student);
+//            em.getTransaction().commit();
+//            System.out.println("Student " + student.getInfo().getName() + " has Selected course:" + course.getCname());
+        }
+
+
+    public void unselectCourse(Student student, Course course) {
+        List<Course> map = student.getCourses();
+//        double totalScore = student.getTotalScore();
+//        totalScore -= 3;
+        map.remove(course);
+        student.setCourses(map);
+//        student.setTotalScore(totalScore);
+//        em.getTransaction().begin();
+        em.merge(student);
+//        em.getTransaction().commit();
+//        System.out.println("Student " + student.getInfo().getName() + " has Canceled course:" + course.getCname());
+    }
+	
+    public void createStudent(Student student) {
+//        System.out.println("in createStudent.");
+//        em.getTransaction().begin();
+        em.persist(student);
+//        em.getTransaction().commit();
+    }
+
+    public void editStudent(Student student) {
+//        em.getTransaction().begin();
+        em.merge(student);
+//        em.getTransaction().commit();
+    }
+
+    public void removeStudent(Student student) {
+//        em.getTransaction().begin();
+        em.remove(em.merge(student));
+//        em.getTransaction().commit();
+    }
+
+    public Student findStudent(int id) {
+        return em.find(Student.class, id);
+    }
+
+    public List<Student> findAllStudent() {
+        CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
+        cq.select(cq.from(Student.class));
+        return em.createQuery(cq).getResultList();
+    }
+
+    public int countStudent() {
+        CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
+        Root<Student> rt = cq.from(Student.class);
+        cq.select(em.getCriteriaBuilder().count(rt));
+        Query q = em.createQuery(cq);
+        return ((Long) q.getSingleResult()).intValue();
+    }
+
+
+    public Course findCourse(int id) {
+        CriteriaBuilder cb = em.getCriteriaBuilder();
+        CriteriaQuery<Course> cq = cb.createQuery(Course.class);
+        Root<Course> course = cq.from(Course.class);
+        cq.select(course).where(cb.equal(course.get("cid"), id));
+        Query query = em.createQuery(cq);
+        Course result = (Course) query.getSingleResult();
+        if (result != null) {
+//            System.out.println("Cousre with id: " + cid + " is found");
+        }
+        return result;
+    }
+
+    public List<Course> findAllCourse() {
+        CriteriaQuery cq = em.getCriteriaBuilder().createQuery();
+        cq.select(cq.from(Course.class));
+        return em.createQuery(cq).getResultList();
+    }
+
+    public Course findCourseByName(String cname) {
+        CriteriaBuilder cb = em.getCriteriaBuilder();
+        CriteriaQuery<Course> cq = cb.createQuery(Course.class);
+        Root<Course> course = cq.from(Course.class);
+        cq.select(course).where(cb.equal(course.get("cname"), cname));
+        Query query = em.createQuery(cq);
+        Course result = (Course) query.getSingleResult();
+        if (result != null) {
+//            System.out.println("Cousre with name: " + cname + " is found");
+        }
+        return result;
+    }
+    
+    public String nullIf(int studentId){
+        String jpql = "SELECT NULLIF(0,0) from Student s where s.id="+studentId ;
+        Query query = em.createQuery(jpql);
+        String result = new String();
+        
+        if( query.getSingleResult()==null){
+        	result = "sucess";
+        }
+        else {
+        	result = "fail, and query return value is:"+query.getSingleResult().toString();
+        }
+        return result;
+    }
+
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/bean/Facade.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/bean/Facade.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/bean/Facade.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Address.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Address.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Address.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Address.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,57 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+
+package org.apache.geronimo.javaee6.jpa20.entities;
+
+import java.io.Serializable;
+import javax.persistence.Embeddable;
+
+@Embeddable
+public class Address implements Serializable  {
+
+    private String country;
+    private String city;
+    private String street;
+
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getCountry() {
+        return country;
+    }
+
+    public void setCountry(String country) {
+        this.country = country;
+    }
+
+    public String getStreet() {
+        return street;
+    }
+
+    public void setStreet(String street) {
+        this.street = street;
+    }
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Address.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Address.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Address.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/BasicInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/BasicInfo.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/BasicInfo.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/BasicInfo.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,68 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+
+package org.apache.geronimo.javaee6.jpa20.entities;
+
+import java.io.Serializable;
+import javax.persistence.Embeddable;
+import javax.persistence.Embedded;
+
+
+@Embeddable
+public class BasicInfo implements Serializable {
+
+    private String name;
+    @Embedded
+    private Address address;
+    private String telephone;
+    private int age;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Address getAddress() {
+        return address;
+    }
+
+    public void setAddress(Address address) {
+        this.address = address;
+    }
+
+    public int getAge() {
+        return age;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+
+    public String getTelephone() {
+        return telephone;
+    }
+
+    public void setTelephone(String telephone) {
+        this.telephone = telephone;
+    }
+    
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/BasicInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/BasicInfo.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/BasicInfo.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Course.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Course.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Course.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Course.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,135 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+
+package org.apache.geronimo.javaee6.jpa20.entities;
+
+import java.io.Serializable;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.ElementCollection;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.ManyToOne;
+import javax.persistence.JoinColumn;
+import javax.persistence.FetchType;
+import javax.persistence.CollectionTable;
+import javax.persistence.OrderColumn;
+import javax.persistence.Table;
+
+@Entity
+@Table(name = "Course")
+public class Course implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    @Id
+    private Integer cid;
+    
+    private String cname;
+    private String classroom;
+    private String teacher;
+    private String assistTeacher;
+
+    @ElementCollection(fetch=FetchType.EAGER)
+    //@CollectionTable(name="COURSE_COMMENTS")
+    private List<String> evaluation;
+
+    public Integer getCid() {
+        return cid;
+    }
+
+    public void setCid(Integer cid) {
+        this.cid = cid;
+    }
+
+    public String getClassroom() {
+        return classroom;
+    }
+
+    public void setClassroom(String classroom) {
+        this.classroom = classroom;
+    }
+
+    public String getCname() {
+        return cname;
+    }
+
+    public void setCname(String cname) {
+        this.cname = cname;
+    }
+
+    public String getTeacher() {
+        return teacher;
+    }
+
+    public void setTeacher(String teacher) {
+        this.teacher = teacher;
+    }
+
+    public String getAssistTeacher() {
+        return assistTeacher;
+    }
+
+    public void setAssistTeacher(String assistTeacher) {
+        this.assistTeacher = assistTeacher;
+    }
+
+/*        public Student getOwner() {
+        return owner;
+    }
+
+    public void setOwner(Student owner) {
+        this.owner = owner;
+    }
+*/
+    public List<String> getEvaluation() {
+        return evaluation;
+    }
+
+    public void setEvaluation(List<String> evaluation) {
+        this.evaluation = evaluation;
+    }
+
+    @Override
+    public int hashCode() {
+        int hash = 0;
+        hash += (cid != null ? cid.hashCode() : 0);
+        return hash;
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        // TODO: Warning - this method won't work in the case the id fields are not set
+        if (!(object instanceof Course)) {
+            return false;
+        }
+        Course other = (Course) object;
+        if ((this.cid == null && other.cid != null) || (this.cid != null && !this.cid.equals(other.cid))) {
+            System.out.println("This cid is" + this.cid + ",other cid is: " + ((Course) object).getCid());
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public String toString() {
+        return "org.apache.geronimo.sample.jpa20.Course[cid=" + cid + "]";
+    }
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Course.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Course.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Course.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Student.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Student.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Student.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Student.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,131 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+
+package org.apache.geronimo.javaee6.jpa20.entities;
+
+import java.io.Serializable;
+import java.util.List;
+import javax.persistence.OneToMany;
+import javax.persistence.CascadeType;
+import javax.persistence.FetchType;
+import javax.persistence.JoinTable;
+import javax.persistence.Embedded;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.Table;
+
+@Entity
+@Table(name="Student")
+public class Student implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+    @Id
+    private Integer id;
+
+    @Embedded
+    private BasicInfo info;
+
+	@OneToMany(cascade={CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH},fetch=FetchType.EAGER )
+    @JoinTable(name="Student_Course",
+			joinColumns={
+				@JoinColumn(name="studentId", referencedColumnName="id")
+			},
+			inverseJoinColumns={
+				@JoinColumn(name="courseId", referencedColumnName="cid")
+			}
+	)
+    private List<Course> courses=null;
+
+    private double totalScore;
+    
+    private String rank;
+    
+    public Student (){
+    	this.totalScore = 0;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public List<Course> getCourses() {
+        return courses;
+    }
+
+    public void setCourses(List<Course> courses) {
+        this.courses = courses;
+    }
+
+    public BasicInfo getInfo() {
+        return info;
+    }
+
+    public void setInfo(BasicInfo info) {
+        this.info = info;
+    }
+
+    public double getTotalScore() {
+        return totalScore;
+    }
+
+    public void setTotalScore(double totalScore) {
+        
+        this.totalScore=totalScore;
+    }
+
+    public String getRank() {
+        return rank;
+    }
+
+    public void setRank(String rank) {
+        this.rank = rank;
+    }
+
+
+    @Override
+    public int hashCode() {
+        int hash = 0;
+        hash += (id != null ? id.hashCode() : 0);
+        return hash;
+    }
+
+    @Override
+    public boolean equals(Object object) {
+        // TODO: Warning - this method won't work in the case the id fields are not set
+        if (!(object instanceof Student)) {
+            return false;
+        }
+        Student other = (Student) object;
+        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public String toString() {
+        return "org.apache.geronimo.sample.jpa20.Student[id=" + id + "]";
+    }
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Student.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Student.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/java/org/apache/geronimo/javaee6/jpa20/entities/Student.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/eclipselink_persistence.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/eclipselink_persistence.xml?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/eclipselink_persistence.xml (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/eclipselink_persistence.xml Thu Dec  2 07:53:09 2010
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You 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.
+-->
+<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
+  <persistence-unit name="CourseSelectPU" transaction-type="JTA">
+    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
+    <jta-data-source>jdbc/sample</jta-data-source>
+    <exclude-unlisted-classes>false</exclude-unlisted-classes>
+    <properties>
+      <property name="eclipselink.ddl-generation" value="create-tables"/>
+    </properties>
+  </persistence-unit>
+</persistence>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/eclipselink_persistence.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/eclipselink_persistence.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/eclipselink_persistence.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/persistence.xml?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/persistence.xml (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/persistence.xml Thu Dec  2 07:53:09 2010
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You 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.
+-->
+
+<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
+  <persistence-unit transaction-type="JTA" name="CourseSelectPU" >
+    <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider> 
+	<jta-data-source>SystemDatasource</jta-data-source>
+	<non-jta-data-source>NoTxDatasource</non-jta-data-source>
+    <class>org.apache.geronimo.javaee6.jpa20.entities.Course</class>
+    <class>org.apache.geronimo.javaee6.jpa20.entities.Student</class>
+	<class>org.apache.geronimo.javaee6.jpa20.entities.BasicInfo</class>
+	<class>org.apache.geronimo.javaee6.jpa20.entities.Address</class>
+    <exclude-unlisted-classes>true</exclude-unlisted-classes>
+    <properties>
+      <property name="openjpa.jdbc.DBDictionary" value="derby"/>
+<!--	  <property name="openjpa.ConnectionURL" value="jdbc:derby://localhost:1527/jpa20demodb;create=true"/>
+	  <property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.ClientDriver"/>
+      <property name="openjpa.ConnectionUserName" value="APP"/>
+      <property name="openjpa.ConnectionPassword" value="APP"/>
+      <property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO"/>
+      <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>	  
+      <property name="openjpa.Sequence" value="table(Table=OPENJPASEQ, Increment=100)"/> -->   
+    </properties>
+  </persistence-unit>
+</persistence>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/persistence.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/persistence.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/persistence.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/persistence_openjpa.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/persistence_openjpa.xml?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/persistence_openjpa.xml (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/persistence_openjpa.xml Thu Dec  2 07:53:09 2010
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You 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.
+-->
+
+<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
+  <persistence-unit name="CourseSelectPU" transaction-type="JTA">
+    <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>    
+    <class>org.apache.geronimo.javaee6.jpa20.entities.Course</class>
+    <class>org.apache.geronimo.javaee6.jpa20.entities.Student</class>
+    <exclude-unlisted-classes>true</exclude-unlisted-classes>
+    <properties>
+      <property name="openjpa.jdbc.DBDictionary " value="derby"/>
+	  <property name="openjpa.ConnectionURL" value="jdbc:derby://localhost:1527/jpa20demodb;create=true"/>
+	  <property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.ClientDriver"/>
+      <property name="openjpa.ConnectionUserName" value="APP"/>
+      <property name="openjpa.ConnectionPassword" value="APP"/>      
+      <property name="openjpa.Sequence" value="table(Table=OPENJPASEQ, Increment=1)"/>   
+      <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
+      <property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO"/>      
+    </properties>
+  </persistence-unit>
+</persistence>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/persistence_openjpa.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/persistence_openjpa.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/resources/META-INF/persistence_openjpa.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/WEB-INF/geronimo-web.xml?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/WEB-INF/geronimo-web.xml (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/WEB-INF/geronimo-web.xml Thu Dec  2 07:53:09 2010
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you 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.
+-->
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
+         xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
+         xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0"
+         xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
+
+  <sys:environment>
+    <sys:moduleId>
+      <sys:groupId>${project.groupId}</sys:groupId>
+      <sys:artifactId>${project.artifactId}</sys:artifactId>
+      <sys:version>${project.version}</sys:version>
+      <sys:type>war</sys:type>
+    </sys:moduleId>
+    <sys:dependencies>
+		<sys:dependency>
+			<sys:artifactId>system-database</sys:artifactId>
+		</sys:dependency>
+	</sys:dependencies>
+    <sys:hidden-classes/>
+    <sys:non-overridable-classes/>
+  </sys:environment>
+
+  <context-root>/${project.artifactId}</context-root>
+
+</web-app>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/WEB-INF/geronimo-web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/WEB-INF/web.xml?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/WEB-INF/web.xml (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/WEB-INF/web.xml Thu Dec  2 07:53:09 2010
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+	Licensed to the Apache Software Foundation (ASF) under one or more
+	contributor license agreements. See the NOTICE file distributed with
+	this work for additional information regarding copyright ownership.
+	The ASF licenses this file to You 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.
+-->
+
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
+  <display-name>jpa2</display-name>
+  <welcome-file-list>
+    <welcome-file>index.html</welcome-file>
+    <welcome-file>index.htm</welcome-file>
+    <welcome-file>index.jsp</welcome-file>
+    <welcome-file>default.html</welcome-file>
+    <welcome-file>default.htm</welcome-file>
+    <welcome-file>default.jsp</welcome-file>
+  </welcome-file-list>
+
+</web-app>
\ No newline at end of file

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/addCourse.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/addCourse.jsp?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/addCourse.jsp (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/addCourse.jsp Thu Dec  2 07:53:09 2010
@@ -0,0 +1,40 @@
+<!--
+
+	Licensed to the Apache Software Foundation (ASF) under one or more
+	contributor license agreements. See the NOTICE file distributed with
+	this work for additional information regarding copyright ownership.
+	The ASF licenses this file to You 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.
+-->
+
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+   "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <title>Add Course</title>
+    </head>
+    <body>
+        <h1>Course Information</h1>
+        <form action="CourseAdd">
+            <table border="1px">
+            <tr><td align="right">Course ID</td><td><input type="text" name="cid"></td></tr>
+            <tr><td align="right">Course Name</td><td><input type="text" name="cname"></td></tr>
+            <tr><td align="right">Classroom</td><td><input type="text" name="classroom"></td></tr>
+            <tr><td align="right">Teacher</td><td><input type="text" name="teacher"></td></tr>
+            <tr><td align="right">Assist Teacher</td><td><input type="text" name="assistTeacher"></td></tr>
+        </table>
+            <input type="submit" value="Save">
+        </form>
+    </body>
+</html>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/addCourse.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/addCourse.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/addCourse.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/addStudent.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/addStudent.jsp?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/addStudent.jsp (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/addStudent.jsp Thu Dec  2 07:53:09 2010
@@ -0,0 +1,59 @@
+<!--
+
+	Licensed to the Apache Software Foundation (ASF) under one or more
+	contributor license agreements. See the NOTICE file distributed with
+	this work for additional information regarding copyright ownership.
+	The ASF licenses this file to You 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.
+-->
+
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+    "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <title>JSP Page</title>
+    </head>
+    <body>
+        <h1>Student Information</h1>
+        <form action="StudentAdd">
+            <table>
+                 <tr>
+                    <td align="right">Student ID</td>
+                    <td><input type="text" name="sid"></td>
+                </tr>
+                <tr>
+                    <td align="right">Student Name</td>
+                    <td><input type="text" name="sname"></td>
+                </tr>
+                <tr>
+                    <td align="right">Address</td>
+                    <td>
+                        Country:<input type="text" name="country" size="38px"><br>
+                        City:<input type="text" name="city" size="38px"><br>
+                        Street:<input type="text" name="street" size="38px"><br>
+                    </td>
+                </tr>
+                <tr>
+                    <td align="right">Telephone</td>
+                    <td><input type="text" name="telephone"></td>
+                </tr>
+                <tr>
+                    <td align="right">Age(Integer)</td>
+                    <td><input type="text" name="age"></td>
+                </tr>
+            </table>
+            <input type="submit" value="Save">
+        </form>
+    </body>
+</html>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/addStudent.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/addStudent.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/addStudent.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/index.jsp?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/index.jsp (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/index.jsp Thu Dec  2 07:53:09 2010
@@ -0,0 +1,36 @@
+<!--
+
+	Licensed to the Apache Software Foundation (ASF) under one or more
+	contributor license agreements. See the NOTICE file distributed with
+	this work for additional information regarding copyright ownership.
+	The ASF licenses this file to You 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.
+-->
+
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+    "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <title>JSP Page</title>
+    </head>
+    <body>
+        <a href="viewStudents">View All Studens</a>
+        <a href="addStudent">Add Studens</a>
+        <br>
+        <a href="viewCourses">View All Courses</a>
+        <a href="addCourse">Add Courses</a>
+
+
+    </body>
+</html>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/index.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/index.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/queryCourseByName.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/queryCourseByName.jsp?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/queryCourseByName.jsp (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/queryCourseByName.jsp Thu Dec  2 07:53:09 2010
@@ -0,0 +1,46 @@
+<!--
+
+	Licensed to the Apache Software Foundation (ASF) under one or more
+	contributor license agreements. See the NOTICE file distributed with
+	this work for additional information regarding copyright ownership.
+	The ASF licenses this file to You 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.
+-->
+
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+    "http://www.w3.org/TR/html4/loose.dtd">
+<%@page import="org.apache.geronimo.javaee6.jpa20.entities.Student" %>
+<%@page import="org.apache.geronimo.javaee6.jpa20.entities.Course" %>
+<%@page import="org.apache.geronimo.javaee6.jpa20.bean.Facade" %>
+<%@page import="java.util.List" %>
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <title>JSP Page</title>
+    </head>
+    <body>
+
+        <%
+                    Facade facade = new Facade();
+                    String cname = request.getParameter("cname");
+                    Course c = facade.findCourseByName(cname);
+        %>
+             Query Information is:
+            <ol>
+                <li>
+                    Course ID:<%=c.getCid()%>
+                    <br/>
+                    Course NAME:<%=c.getCname()%>
+                </li>
+            </ol>
+    </body>
+</html>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/queryCourseByName.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/queryCourseByName.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/queryCourseByName.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/selectCourse.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/selectCourse.jsp?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/selectCourse.jsp (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/selectCourse.jsp Thu Dec  2 07:53:09 2010
@@ -0,0 +1,79 @@
+<!--
+
+	Licensed to the Apache Software Foundation (ASF) under one or more
+	contributor license agreements. See the NOTICE file distributed with
+	this work for additional information regarding copyright ownership.
+	The ASF licenses this file to You 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.
+-->
+
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@page import="java.util.Set" %>
+<%@page import="java.util.List" %>
+<%@page import="org.apache.geronimo.javaee6.jpa20.entities.Student" %>
+<%@page import="org.apache.geronimo.javaee6.jpa20.entities.Course" %>
+<%@page import="org.apache.geronimo.javaee6.jpa20.bean.Facade"%>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <title>JSP Page</title>
+    </head>
+    <body>
+        <%
+                    String sid = request.getParameter("sid");
+                    Facade facade = new Facade();
+                    int intsid = Integer.parseInt(sid);
+                    Student student = facade.findStudent(intsid);
+        %>
+        <a>Welcome!Student Name:<%=student.getInfo().getName()%></a>
+        <%
+        List<Course> selectedCourses = student.getCourses();
+        %>
+
+        <h2>Want to Select Course?</h2>
+        <ol>
+            <%
+                        List<Course> courses = facade.findAllCourse();
+                        for (Course course : courses) {
+                            if (!selectedCourses.contains(course)){
+            %>
+                <li>Course name:
+                    Here Select <%=course.getCname()%> from selectCourse.jsp
+                    <a href="CourseSelect?cid=<%=course.getCid()%>&sid=<%=student.getId()%>">Select This Course</a>
+                </li>
+
+            <%}}%>
+        </ol>
+
+         <h2>Want to Cancel selected Course?</h2>
+
+        <ol>
+            <%for (Course course : selectedCourses) {%>
+            <li>Course name:
+                    Here Unselect <%=course.getCname()%> from selectCourse.jsp
+                    <a href="CourseUnselect?cid=<%=course.getCid()%>&sid=<%=student.getId()%>">Unselect This Course</a>
+            </li>
+            <%}%>
+        </ol>
+
+         <h2>All Courses:</h2>
+         <ol>
+         <%for(Course course: courses){%>
+            <li>Course name:
+                All courses includes <%=course.getCname()%> from selectCourse.jsp<br/>
+            </li>
+         <%}%>
+         </ol>
+    </body>
+</html>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/selectCourse.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/selectCourse.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/selectCourse.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/testComment.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/testComment.jsp?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/testComment.jsp (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/testComment.jsp Thu Dec  2 07:53:09 2010
@@ -0,0 +1,46 @@
+<!--
+
+	Licensed to the Apache Software Foundation (ASF) under one or more
+	contributor license agreements. See the NOTICE file distributed with
+	this work for additional information regarding copyright ownership.
+	The ASF licenses this file to You 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.
+-->
+
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+         pageEncoding="ISO-8859-1"%>
+<%@page import="org.apache.geronimo.javaee6.jpa20.bean.Facade" %>
+<%@page import="org.apache.geronimo.javaee6.jpa20.entities.Course" %>
+<%@page import="org.apache.geronimo.javaee6.jpa20.entities.Evaluation" %>
+<%@page import="java.util.List" %>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+   "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+        <title>View Comment</title>
+    </head>
+    <body>
+        This page shows 10 comments on Course.<br>
+       <%Facade facade = new Facade();
+                    String cidString = request.getParameter("cid");
+                    int cid = Integer.parseInt(cidString);
+                    Course course = facade.findCourse(cid);
+                    //System.out.println(cidString+" ,"+cid);
+        %>
+        
+    <a href="CommentAdd?cid=<%=course.getCid()%>">Click here to add 20 Comments!</a>
+    <br/>
+    <a href="viewAllComments.jsp?cid=<%=course.getCid()%>">Click here to view all comments!</a>
+    </body>
+</html>
\ No newline at end of file

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/testComment.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/testComment.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/testComment.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/viewAllComments.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/viewAllComments.jsp?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/viewAllComments.jsp (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/viewAllComments.jsp Thu Dec  2 07:53:09 2010
@@ -0,0 +1,57 @@
+<!--
+
+	Licensed to the Apache Software Foundation (ASF) under one or more
+	contributor license agreements. See the NOTICE file distributed with
+	this work for additional information regarding copyright ownership.
+	The ASF licenses this file to You 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.
+-->
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+         pageEncoding="ISO-8859-1"%>
+<%@page import="org.apache.geronimo.javaee6.jpa20.bean.Facade" %>
+<%@page import="org.apache.geronimo.javaee6.jpa20.entities.Course" %>
+<%@page import="org.apache.geronimo.javaee6.jpa20.entities.Evaluation" %>
+<%@page import="java.util.List" %>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+        <title>View Comment</title>
+    </head>
+    <body>
+        This page displays comments on Course.<br>
+
+        <%Facade facade = new Facade();
+                    String cidString = request.getParameter("cid");
+                    int cid = Integer.parseInt(cidString);
+                    Course course = facade.findCourse(cid);
+
+        %>
+                <hr>
+        Course Name:<%=course.getCname()%>,totally there are <%=course.getEvaluation().size()%> comments.<br>
+        <%
+        List<Evaluation> all = course.getEvaluation();
+        %>
+        <h2>All Comments</h2><hr>
+        <ol>
+            <%
+            for (Evaluation e : all) {
+                //System.out.println("in viewAllComments!!!!!!!!"+e.getComment());
+            %>
+            <li>
+                Comment:<%=e.getComment()%> from viewAllComments.jsp
+            </li>
+            <%
+             }%>
+        </ol>
+    </body>
+</html>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/viewAllComments.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/viewAllComments.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/viewAllComments.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/viewCourses.jsp
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/viewCourses.jsp?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/viewCourses.jsp (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/viewCourses.jsp Thu Dec  2 07:53:09 2010
@@ -0,0 +1,61 @@
+<!--
+
+	Licensed to the Apache Software Foundation (ASF) under one or more
+	contributor license agreements. See the NOTICE file distributed with
+	this work for additional information regarding copyright ownership.
+	The ASF licenses this file to You 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.
+-->
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@page import="java.util.List" %>
+<%@page import="org.apache.geronimo.javaee6.jpa20.entities.Course" %>
+<%@page import="javax.ejb.EJB" %>
+<%@page import="org.apache.geronimo.javaee6.jpa20.bean.Facade" %>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+    "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+        <title>JSP Page</title>
+    </head>
+    <body>
+        <table border="1px">
+            <tr>
+                <td>Course Name</td>
+                <td>Classroom</td>
+                <td>Teacher</td>
+                <td>Assist Teacher</td>
+                <td>actions</td>
+        
+            </tr>
+            <%
+
+            Facade facade;
+            List<Course> courses = facade.findAllCourse();
+                   for (Course course : courses) {%>
+            <tr>
+                <td><%=course.getCname()%></td>
+                <td><%=course.getClassroom()%></td>
+                <td><%=course.getTeacher()%></td>
+                <td><%=course.getAssistTeacher()%></td>
+                <td>
+                <a href="testComment.jsp?cid=<%=course.getCid()%>">Comments</a>
+                <a href="queryCourseByName.jsp?cname=<%=course.getCname()%>">Query Course By Name</a>
+                <a href="CourseDelete?cid=<%=course.getCid()%>">Delete</a>
+                </td>
+
+            </tr>
+            <%}%>
+        </table>       
+        <a href="addCourse.jsp">Add Course</a>
+    </body>
+</html>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/viewCourses.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/viewCourses.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/main/webapp/viewCourses.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/java/org/apache/geronimo/javaee6/jpa20/tests/JPATest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/java/org/apache/geronimo/javaee6/jpa20/tests/JPATest.java?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/java/org/apache/geronimo/javaee6/jpa20/tests/JPATest.java (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/java/org/apache/geronimo/javaee6/jpa20/tests/JPATest.java Thu Dec  2 07:53:09 2010
@@ -0,0 +1,290 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+
+package org.apache.geronimo.javaee6.jpa20.tests;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.HttpMethodBase;
+import org.apache.commons.httpclient.methods.PostMethod;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+public class JPATest {
+	private static String root ;
+	
+	/**
+	 * Test 1
+	 * Test 
+	 * Criteria Query feature.
+	 * @throws Exception
+	 */
+	@Test
+	public void addCourseTest()throws Exception
+	{
+		String contextroot = System.getProperty("appContext");
+		root = "http://localhost:8080/"+contextroot;
+		
+		HttpClient nclient = new HttpClient();
+		String url = root+"/CourseAdd?cid=1&cname=course1&classroom=course1&teacher=course1&assistTeacher=course1";
+		HttpMethodBase httpMethod;
+		httpMethod = new PostMethod(url);
+		nclient.executeMethod(httpMethod);
+		httpMethod.releaseConnection();
+		
+		url = root+"/ListQuery?cname=course1";
+		HttpMethodBase httpMethod2;
+		httpMethod2 = new PostMethod(url);
+		int status = nclient.executeMethod(httpMethod2);
+		Assert.assertEquals(status, 200);
+//		System.out.println("status:" + status);
+		String response = null;
+		if(status==200)
+		{
+			response = new String(httpMethod2.getResponseBodyAsString().getBytes("8859_1"));
+		}
+		Assert.assertTrue(response.contains("course name is :course1 from listQuery."));
+	
+		httpMethod2.releaseConnection();
+	}
+
+	
+	/**
+	 * Test 2
+	 * Test 
+	 * @ElementCollection annotation
+	 * */
+	@Test(dependsOnMethods = { "addCourseTest" })
+	public void addCommentTest() throws HttpException, Exception
+	{
+		HttpClient nclient = new HttpClient();
+		String url = root+"/CommentAdd?cid=1";
+		HttpMethodBase httpMethod;
+		httpMethod = new PostMethod(url);
+		nclient.executeMethod(httpMethod);
+		httpMethod.releaseConnection();
+		
+		url = root+"/viewAllComments?cid=1";
+		HttpMethodBase httpMethod2;
+		httpMethod2 = new PostMethod(url);
+		int status = nclient.executeMethod(httpMethod2);
+		System.out.println("status:" + status);
+		String response = null;
+		if(status==200)
+		{
+			response = new String(httpMethod2.getResponseBodyAsString().getBytes("8859_1"));
+		}
+		Assert.assertTrue(response.contains("Comment:comment0 from viewAllComments"));
+		
+		httpMethod2.releaseConnection();	
+	}
+	
+	/**
+	 * Test 3
+	 * Test 
+	 * @Embedded annotation
+	 * @Embeddable annotation
+	 * @throws Exception 
+	 * @throws HttpException 
+	 */
+	@Test(dependsOnMethods = { "addCourseTest" })
+	public void AddStudentTest() throws HttpException, Exception
+	{
+		HttpClient nclient = new HttpClient();
+		String url = root+"/StudentAdd?sid=1&sname=s1&country=country1&city=city1&street=street1&telephone=111111&age=11&score=0";
+		HttpMethodBase httpMethod;
+		httpMethod = new PostMethod(url);
+		nclient.executeMethod(httpMethod);
+		httpMethod.releaseConnection();
+		
+		url = root+"/viewStudents";
+		HttpMethodBase httpMethod2;
+		httpMethod2 = new PostMethod(url);
+		nclient.executeMethod(httpMethod2);
+		int status = nclient.executeMethod(httpMethod2);
+		Assert.assertEquals(status,200);
+//		System.out.println("status:" + status);
+		
+		String response = null;
+		if(status==200)
+		{
+			response = new String(httpMethod2.getResponseBodyAsString().getBytes("8859_1"));
+		}
+		Assert.assertTrue(response.contains("Country:country1"));
+		Assert.assertTrue(response.contains("City:city1"));
+		Assert.assertTrue(response.contains("Street:street1"));
+		httpMethod2.releaseConnection();
+	}
+	
+	/**
+	 * Test 4
+	 * Test
+	 * Foreign key function--add one ONE-TO-MANY record
+	 * @throws HttpException
+	 * @throws Exception
+	 */
+	
+	@Test(dependsOnMethods = { "AddStudentTest" })
+	public void SelectCourseTest() throws HttpException, Exception
+	{
+		HttpClient nclient = new HttpClient();
+		String url = root+"/viewSelect_CourseRelation?sid=1";
+		HttpMethodBase httpMethod;
+		httpMethod = new PostMethod(url);
+		int status = nclient.executeMethod(httpMethod);
+//		System.out.println("status:" + status);
+		String response = null;
+		Assert.assertEquals(status, 200);
+		if(status==200)
+		{
+			response = new String(httpMethod.getResponseBodyAsString().getBytes("8859_1"));
+		}
+		Assert.assertTrue(response.contains("Click Here to Select course1 from selectCourse"));
+		httpMethod.releaseConnection();
+		
+		
+		url = root+"/CourseSelect?cid=1&sid=1";
+		httpMethod = new PostMethod(url);
+		status = nclient.executeMethod(httpMethod);
+		Assert.assertEquals(status, 200);
+//		System.out.println("status:" + status);
+		response = null;
+		if(status==200)
+		{
+			response = new String(httpMethod.getResponseBodyAsString().getBytes("8859_1"));
+		}
+		Assert.assertTrue(response.contains("Click Here to Unselect course1 from selectCourse"));
+		httpMethod.releaseConnection();
+	}
+	
+	/**
+	 * Test 5
+	 * Test
+	 * Foreign key function--delete one ONE-TO-MANY record
+	 * @throws HttpException
+	 * @throws Exception
+	 */
+	@Test(dependsOnMethods = { "SelectCourseTest" })
+	public void UnselectCourseTest() throws HttpException, Exception
+	{
+		String result=null;
+		String response = null;
+		HttpClient nclient = new HttpClient();
+		String url = root+"/CourseUnselect?cid=1&sid=1";
+		HttpMethodBase httpMethod;
+		httpMethod = new PostMethod(url);
+		int status = nclient.executeMethod(httpMethod);
+//		System.out.println("status:" + status);
+
+		Assert.assertEquals(status, 200);
+
+		if(status==200)
+		{
+			response = new String(httpMethod.getResponseBodyAsString().getBytes("8859_1"));
+		}
+		Assert.assertTrue(response.contains("Click Here to Select course1 from selectCourse"));
+		httpMethod.releaseConnection();
+	}
+	
+	/**
+	 * Test 6
+	 * Test
+	 * Insert and delete Student Record.
+	 * @throws HttpException
+	 * @throws Exception
+	 */
+	@Test
+	public void Insert_Del_Stu_Test() throws HttpException, Exception
+	{
+		String response = null;
+		HttpClient nclient = new HttpClient();
+		String url = root+"/StudentAdd?sid=2&sname=student2&country=country2&city=city2&street=street2&telephone=222222&age=22&score=0";
+		HttpMethodBase httpMethod;
+		httpMethod = new PostMethod(url);
+		int status = nclient.executeMethod(httpMethod);
+//		System.out.println("status:" + status);
+		Assert.assertEquals(status, 200);
+		httpMethod.releaseConnection();
+		
+		url = root +"/viewAllStudents";
+		HttpMethodBase httpMethod2;
+		httpMethod2 = new PostMethod(url);
+		status = nclient.executeMethod(httpMethod2);
+		Assert.assertEquals(status, 200);
+		if(status==200)
+		{
+			response = new String(httpMethod2.getResponseBodyAsString().getBytes("8859_1"));
+		}
+		Assert.assertTrue(response.contains("student2"));
+		httpMethod2.releaseConnection();
+	
+	
+		url = root +"/StudentDelete?sid=2";
+		httpMethod = new PostMethod(url);
+		status = nclient.executeMethod(httpMethod);
+		Assert.assertEquals(status, 200);
+		httpMethod.releaseConnection();
+		
+		url = root +"/viewAllStudents";
+		httpMethod2 = new PostMethod(url);
+		status = nclient.executeMethod(httpMethod2);
+		Assert.assertEquals(status, 200);
+		if(status==200)
+		{
+			response = new String(httpMethod2.getResponseBodyAsString().getBytes("8859_1"));
+		}
+		Assert.assertTrue(!response.contains("student2"));
+		httpMethod2.releaseConnection();
+	}
+	
+	/**
+	 * Test 7
+	 * Test
+	 * NULLIF in JPQL
+	 * @throws HttpException
+	 * @throws Exception
+	 */
+	@Test
+	public void NullIf_JPQL_Test() throws HttpException, Exception
+	{
+		String response = null;
+		HttpClient nclient = new HttpClient();
+		String url = root+"/StudentAdd?sid=3&sname=student3&country=country3&city=city3&street=street3&telephone=333333&age=33&score=0";
+		HttpMethodBase httpMethod;
+		httpMethod = new PostMethod(url);
+		int status = nclient.executeMethod(httpMethod);
+//		System.out.println("status:" + status);
+		Assert.assertEquals(status, 200);
+		httpMethod.releaseConnection();	
+		
+		url = root+"/nullIfJPQL?sid=3";
+		HttpMethodBase httpMethod2;
+		httpMethod2 = new PostMethod(url);
+		status = nclient.executeMethod(httpMethod2);
+		Assert.assertEquals(status, 200);
+		if(status==200)
+		{
+			response = new String(httpMethod2.getResponseBodyAsString().getBytes("8859_1"));
+		}
+		Assert.assertTrue(response.contains("Nullif is sucess."));
+		httpMethod2.releaseConnection();	
+	}
+
+}

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/java/org/apache/geronimo/javaee6/jpa20/tests/JPATest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/java/org/apache/geronimo/javaee6/jpa20/tests/JPATest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/java/org/apache/geronimo/javaee6/jpa20/tests/JPATest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/resources/testng.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/resources/testng.xml?rev=1041298&view=auto
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/resources/testng.xml (added)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/resources/testng.xml Thu Dec  2 07:53:09 2010
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you 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.
+-->
+
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
+
+<suite name="Suite1" verbose="5">
+    <test name="javaee6-testsuite.jpa2.0Test">
+        <packages>
+            <package name="org.apache.geronimo.javaee6.jpa20.tests"/>
+        </packages>
+    </test>
+</suite>

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/resources/testng.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/resources/testng.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/testsuite/javaee6-testsuite/jpa2.0-test/src/test/resources/testng.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: geronimo/server/trunk/testsuite/javaee6-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/testsuite/javaee6-testsuite/pom.xml?rev=1041298&r1=1041297&r2=1041298&view=diff
==============================================================================
--- geronimo/server/trunk/testsuite/javaee6-testsuite/pom.xml (original)
+++ geronimo/server/trunk/testsuite/javaee6-testsuite/pom.xml Thu Dec  2 07:53:09 2010
@@ -66,6 +66,7 @@
         <module>servlet3.0-test</module>
         <!--<module>webbean1.0-test</module>-->
         <module>ejb3.1-test</module>
+        <module>jpa2.0-test</module>
     </modules>
 
 </project>



Mime
View raw message