Author: ieb
Date: Sun Dec 14 19:51:07 2008
New Revision: 726612

URL: http://svn.apache.org/viewvc?rev=726612&view=rev
Log:
 SHINDIG-773
 Fixed formatting and remove System.out

Modified:
    
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/ActivityDb.java

Modified: 
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/ActivityDb.java
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/ActivityDb.java?rev=726612&r1=726611&r2=726612&view=diff
==============================================================================
--- 
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/ActivityDb.java
 (original)
+++ 
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/ActivityDb.java
 Sun Dec 14 19:51:07 2008
@@ -65,8 +65,8 @@
   public static final String JPQL_FINDBY_ACTIVITIES = null;
 
   /**
-   * The internal object ID used for references to this object. Should be 
generated by the
-   * underlying storage mechanism
+   * The internal object ID used for references to this object. Should be
+   * generated by the underlying storage mechanism
    */
   @Id
   @GeneratedValue(strategy = IDENTITY)
@@ -82,6 +82,7 @@
 
   /**
    * model field.
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity
    */
   @Basic
@@ -90,6 +91,7 @@
 
   /**
    * model field.
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity
    */
   @Basic
@@ -98,6 +100,7 @@
 
   /**
    * model field.
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity
    */
   @Basic
@@ -106,6 +109,7 @@
 
   /**
    * model field.
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity
    */
   @Basic
@@ -114,6 +118,7 @@
 
   /**
    * model field.
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity
    */
   @Basic
@@ -122,6 +127,7 @@
 
   /**
    * model field.
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity
    */
   @Basic
@@ -130,21 +136,20 @@
   protected Date updated;
 
   /**
-   * A list of shared media items associated with this activity, joined by the 
table
-   * "activity_media" such that activity_media.activity_id = activity.oid and
-   * activity_media.media_id = media.oid. Media items may be shared amongst
+   * A list of shared media items associated with this activity, joined by the
+   * table "activity_media" such that activity_media.activity_id = activity.oid
+   * and activity_media.media_id = media.oid. Media items may be shared amongst
    * many activities or other entities.
    */
   @ManyToMany(targetEntity = MediaItemDb.class, cascade = ALL)
   @JoinTable(name = "activity_media",
-      joinColumns = @JoinColumn
-      ( name = "activity_id", referencedColumnName = "oid"),
-      inverseJoinColumns = @JoinColumn
-      (name = "media_id", referencedColumnName = "oid"))
+      joinColumns = @JoinColumn(name = "activity_id", referencedColumnName = 
"oid"),
+      inverseJoinColumns = @JoinColumn(name = "media_id", referencedColumnName 
= "oid"))
   protected List<MediaItem> mediaItems;
 
   /**
    * model field.
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity
    */
   @Basic
@@ -153,6 +158,7 @@
 
   /**
    * model field.
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity
    */
   @Basic
@@ -161,6 +167,7 @@
 
   /**
    * model field.
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity
    */
   @Basic
@@ -169,6 +176,7 @@
 
   /**
    * model field.
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity
    */
   @Basic
@@ -177,6 +185,7 @@
 
   /**
    * model field.
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity
    */
   @Basic
@@ -185,6 +194,7 @@
 
   /**
    * model field.
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity
    */
   @Basic
@@ -192,24 +202,25 @@
   protected String streamUrl;
 
   /**
-   * Create map using ActivityTemplateParamsDb such that 
ActivityTemplateParams are joined on oid ->
-   * activity_id and then the name value becomes the key, and the value 
becomes the value
-   * unfortunately JPA wont do Map<String,String> so this is handled in the 
prePersist and postLoad
-   * hook.
+   * Create map using ActivityTemplateParamsDb such that ActivityTemplateParams
+   * are joined on oid -> activity_id and then the name value becomes the key,
+   * and the value becomes the value unfortunately JPA wont do
+   * Map<String,String> so this is handled in the prePersist and postLoad hook.
    */
   @OneToMany(targetEntity = ActivityTemplateParamsDb.class, mappedBy = 
"activity", cascade = ALL)
   @MapKey(name = "name")
   protected Map<String, ActivityTemplateParamsDb> templateParamsDb = new 
ConcurrentHashMap<String, ActivityTemplateParamsDb>();
 
   /**
-   * The transient store for templateParamers loaded by the postLoad hook and 
persisted by the
-   * prePersist hook.
+   * The transient store for templateParamers loaded by the postLoad hook and
+   * persisted by the prePersist hook.
    */
   @Transient
   protected Map<String, String> templateParams;
 
   /**
    * model field.
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity
    */
   @Basic
@@ -218,6 +229,7 @@
 
   /**
    * model field.
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity
    */
   @Basic
@@ -226,6 +238,7 @@
 
   /**
    * model field.
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity
    */
   @Basic
@@ -234,6 +247,7 @@
 
   /**
    * model field.
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity
    */
   @Basic
@@ -250,6 +264,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity#getAppId()
    */
   public String getAppId() {
@@ -258,6 +273,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setAppId(java.lang.String)
    */
   public void setAppId(String appId) {
@@ -266,6 +282,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity#getBody()
    */
   public String getBody() {
@@ -274,6 +291,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setBody(java.lang.String)
    */
   public void setBody(String body) {
@@ -282,6 +300,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity#getBodyId()
    */
   public String getBodyId() {
@@ -290,6 +309,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setBodyId(java.lang.String)
    */
   public void setBodyId(String bodyId) {
@@ -298,6 +318,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity#getExternalId()
    */
   public String getExternalId() {
@@ -306,6 +327,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setExternalId(java.lang.String)
    */
   public void setExternalId(String externalId) {
@@ -314,6 +336,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity#getId()
    */
   public String getId() {
@@ -322,6 +345,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setId(java.lang.String)
    */
   public void setId(String id) {
@@ -330,6 +354,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity#getUpdated()
    */
   public Date getUpdated() {
@@ -341,6 +366,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setUpdated(java.util.Date)
    */
   public void setUpdated(Date updated) {
@@ -353,6 +379,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity#getMediaItems()
    */
   public List<MediaItem> getMediaItems() {
@@ -361,6 +388,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setMediaItems(java.util.List)
    */
   public void setMediaItems(List<MediaItem> mediaItems) {
@@ -369,6 +397,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity#getPostedTime()
    */
   public Long getPostedTime() {
@@ -377,6 +406,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setPostedTime(java.lang.Long)
    */
   public void setPostedTime(Long postedTime) {
@@ -385,6 +415,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity#getPriority()
    */
   public Float getPriority() {
@@ -393,6 +424,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setPriority(java.lang.Float)
    */
   public void setPriority(Float priority) {
@@ -401,6 +433,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#getStreamFaviconUrl()
    */
   public String getStreamFaviconUrl() {
@@ -409,6 +442,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setStreamFaviconUrl(java.lang.String)
    */
   public void setStreamFaviconUrl(String streamFaviconUrl) {
@@ -417,6 +451,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#getStreamSourceUrl()
    */
   public String getStreamSourceUrl() {
@@ -425,6 +460,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setStreamSourceUrl(java.lang.String)
    */
   public void setStreamSourceUrl(String streamSourceUrl) {
@@ -433,6 +469,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity#getStreamTitle()
    */
   public String getStreamTitle() {
@@ -441,6 +478,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setStreamTitle(java.lang.String)
    */
   public void setStreamTitle(String streamTitle) {
@@ -449,6 +487,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity#getStreamUrl()
    */
   public String getStreamUrl() {
@@ -457,6 +496,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setStreamUrl(java.lang.String)
    */
   public void setStreamUrl(String streamUrl) {
@@ -465,6 +505,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#getTemplateParams()
    */
   public Map<String, String> getTemplateParams() {
@@ -473,6 +514,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setTemplateParams(java.util.Map)
    */
   public void setTemplateParams(Map<String, String> templateParams) {
@@ -481,6 +523,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity#getTitle()
    */
   public String getTitle() {
@@ -489,6 +532,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setTitle(java.lang.String)
    */
   public void setTitle(String title) {
@@ -497,6 +541,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity#getTitleId()
    */
   public String getTitleId() {
@@ -505,6 +550,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setTitleId(java.lang.String)
    */
   public void setTitleId(String titleId) {
@@ -513,6 +559,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity#getUrl()
    */
   public String getUrl() {
@@ -521,6 +568,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setUrl(java.lang.String)
    */
   public void setUrl(String url) {
@@ -529,6 +577,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see org.apache.shindig.social.opensocial.model.Activity#getUserId()
    */
   public String getUserId() {
@@ -537,6 +586,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see 
org.apache.shindig.social.opensocial.model.Activity#setUserId(java.lang.String)
    */
   public void setUserId(String userId) {
@@ -545,6 +595,7 @@
 
   /**
    * {...@inheritdoc}
+   *
    * @see org.apache.shindig.social.opensocial.jpa.api.DbObject#getObjectId()
    */
   public long getObjectId() {
@@ -552,12 +603,11 @@
   }
 
   /**
-   * Hook into the pre persist JPA event to take the transient fields and 
populate the DB fields
-   * prior to persisting the data
+   * Hook into the pre persist JPA event to take the transient fields and
+   * populate the DB fields prior to persisting the data.
    */
   @PrePersist
   public void populateDbFields() {
-    System.out.println("---------------- populateDbFields");
     // add new entries
     for (Entry<String, String> e : templateParams.entrySet()) {
       ActivityTemplateParamsDb a = templateParamsDb.get(e.getKey());
@@ -566,8 +616,8 @@
         a.name = e.getKey();
         a.value = e.getValue();
         a.activity = this;
-        //a.activities = new ArrayList<Activity>();
-        //a.activities.add(this);
+        // a.activities = new ArrayList<Activity>();
+        // a.activities.add(this);
         templateParamsDb.put(e.getKey(), a);
       } else {
         a.value = e.getValue();
@@ -575,7 +625,8 @@
     }
     // remove old entries
     List<String> toRemove = new ArrayList<String>();
-    for (Entry<String, ActivityTemplateParamsDb> e : 
templateParamsDb.entrySet()) {
+    for (Entry<String, ActivityTemplateParamsDb> e : templateParamsDb
+        .entrySet()) {
       if (!templateParams.containsKey(e.getKey())) {
         toRemove.add(e.getKey());
       }
@@ -583,21 +634,19 @@
     for (String r : toRemove) {
       templateParamsDb.remove(r);
     }
-    System.out.println("---------------- DONE populateDbFields");
   }
 
   /**
-   * Hook into the post load event in JPA to take the database fields and load 
the transient fields
-   * prior to making the object available to java
+   * Hook into the post load event in JPA to take the database fields and load
+   * the transient fields prior to making the object available to java.
    */
   @PostLoad
   public void loadTransientFields() {
-    System.out.println("---------------- loadTransientFields");
     templateParams = new ConcurrentHashMap<String, String>();
-    for (Entry<String, ActivityTemplateParamsDb> e : 
templateParamsDb.entrySet()) {
+    for (Entry<String, ActivityTemplateParamsDb> e : templateParamsDb
+        .entrySet()) {
       templateParams.put(e.getKey(), e.getValue().value);
     }
-    System.out.println("---------------- DONE loadTransientFields");
   }
 
 }


Reply via email to