incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mahrw...@apache.org
Subject svn commit: r919550 - /incubator/aries/trunk/samples/blog-sample/blog-persistence-jpa/src/main/java/org/apache/aries/samples/blog/persistence/entity/EntryImpl.java
Date Fri, 05 Mar 2010 19:27:26 GMT
Author: mahrwald
Date: Fri Mar  5 19:27:25 2010
New Revision: 919550

URL: http://svn.apache.org/viewvc?rev=919550&view=rev
Log:
Add JPA annotations

Modified:
    incubator/aries/trunk/samples/blog-sample/blog-persistence-jpa/src/main/java/org/apache/aries/samples/blog/persistence/entity/EntryImpl.java

Modified: incubator/aries/trunk/samples/blog-sample/blog-persistence-jpa/src/main/java/org/apache/aries/samples/blog/persistence/entity/EntryImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/blog-sample/blog-persistence-jpa/src/main/java/org/apache/aries/samples/blog/persistence/entity/EntryImpl.java?rev=919550&r1=919549&r2=919550&view=diff
==============================================================================
--- incubator/aries/trunk/samples/blog-sample/blog-persistence-jpa/src/main/java/org/apache/aries/samples/blog/persistence/entity/EntryImpl.java
(original)
+++ incubator/aries/trunk/samples/blog-sample/blog-persistence-jpa/src/main/java/org/apache/aries/samples/blog/persistence/entity/EntryImpl.java
Fri Mar  5 19:27:25 2010
@@ -23,6 +23,11 @@
 
 import javax.persistence.Entity;
 import javax.persistence.Table;
+import javax.persistence.Id;
+import javax.persistence.GeneratedValue;
+import javax.persistence.FetchType;
+import javax.persistence.ManyToOne;
+import javax.persistence.Column;
 
 import org.apache.aries.samples.blog.persistence.api.Entry;
 
@@ -36,11 +41,12 @@
 public class EntryImpl implements Entry
 {
   /** An auto-generated primary key */
-
+	@Id
+	@GeneratedValue
   private Long id;
 
   /** The author of the blog post */
-
+	@ManyToOne(fetch=FetchType.EAGER)
   private AuthorImpl author;
 
   /** The date the post was published */
@@ -52,7 +58,7 @@
   /** Tags associated with the post */
   private List<String> tags;
   /** The text of the blog */
-
+	@Column(length=10000)
   private String blogText;
 
   /** Get the author of this blog post */



Mime
View raw message