tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlmonte...@apache.org
Subject svn commit: r1356448 - in /openejb/trunk/openejb/examples/injection-of-entitymanager: README.md src/main/java/org/superbiz/injection/jpa/Movie.java
Date Mon, 02 Jul 2012 20:10:07 GMT
Author: jlmonteiro
Date: Mon Jul  2 20:10:05 2012
New Revision: 1356448

URL: http://svn.apache.org/viewvc?rev=1356448&view=rev
Log:
Adding an @Id to the Movie entity to make it spec compliant

Modified:
    openejb/trunk/openejb/examples/injection-of-entitymanager/README.md
    openejb/trunk/openejb/examples/injection-of-entitymanager/src/main/java/org/superbiz/injection/jpa/Movie.java

Modified: openejb/trunk/openejb/examples/injection-of-entitymanager/README.md
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/examples/injection-of-entitymanager/README.md?rev=1356448&r1=1356447&r2=1356448&view=diff
==============================================================================
--- openejb/trunk/openejb/examples/injection-of-entitymanager/README.md (original)
+++ openejb/trunk/openejb/examples/injection-of-entitymanager/README.md Mon Jul  2 20:10:05
2012
@@ -15,40 +15,51 @@ The entity itself is simply a pojo annot
     
     @Entity
     public class Movie {
-    
+
+        @Id @GeneratedValue
+        private long id;
+
         private String director;
         private String title;
         private int year;
-    
+
         public Movie() {
         }
-    
+
+        public long getId() {
+            return id;
+        }
+
+        public void setId(long id) {
+            this.id = id;
+        }
+
         public Movie(String director, String title, int year) {
             this.director = director;
             this.title = title;
             this.year = year;
         }
-    
+
         public String getDirector() {
             return director;
         }
-    
+
         public void setDirector(String director) {
             this.director = director;
         }
-    
+
         public String getTitle() {
             return title;
         }
-    
+
         public void setTitle(String title) {
             this.title = title;
         }
-    
+
         public int getYear() {
             return year;
         }
-    
+
         public void setYear(int year) {
             this.year = year;
         }

Modified: openejb/trunk/openejb/examples/injection-of-entitymanager/src/main/java/org/superbiz/injection/jpa/Movie.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/examples/injection-of-entitymanager/src/main/java/org/superbiz/injection/jpa/Movie.java?rev=1356448&r1=1356447&r2=1356448&view=diff
==============================================================================
--- openejb/trunk/openejb/examples/injection-of-entitymanager/src/main/java/org/superbiz/injection/jpa/Movie.java
(original)
+++ openejb/trunk/openejb/examples/injection-of-entitymanager/src/main/java/org/superbiz/injection/jpa/Movie.java
Mon Jul  2 20:10:05 2012
@@ -18,10 +18,15 @@ package org.superbiz.injection.jpa;
 //START SNIPPET: code
 
 import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
 
 @Entity
 public class Movie {
 
+    @Id @GeneratedValue
+    private long id;
+
     private String director;
     private String title;
     private int year;
@@ -29,6 +34,14 @@ public class Movie {
     public Movie() {
     }
 
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
     public Movie(String director, String title, int year) {
         this.director = director;
         this.title = title;



Mime
View raw message