rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ja...@apache.org
Subject svn commit: r1169628 [2/2] - in /incubator/rave/trunk: rave-portal/src/main/java/org/apache/rave/portal/model/ rave-portal/src/main/resources/ rave-portal/src/test/resources/ rave-shindig/src/main/java/org/apache/rave/gadgets/oauth/model/ rave-shindig/...
Date Mon, 12 Sep 2011 07:24:41 GMT
Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Group.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Group.java?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Group.java (original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Group.java Mon Sep 12 07:24:40 2011
@@ -20,7 +20,21 @@ package org.apache.rave.opensocial.model
 
 import org.apache.rave.persistence.BasicEntity;
 
-import javax.persistence.*;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
 import java.util.List;
 
 /**
@@ -29,7 +43,6 @@ import java.util.List;
  */
 @Entity
 @Table(name = "groups")
-@SequenceGenerator(name = "groupIdSeq", sequenceName = "group_id_seq")
 @NamedQueries(
         @NamedQuery(name = Group.FIND_BY_ID, query="select g from Group g where g.title = :groupId")
 )
@@ -43,21 +56,23 @@ public class Group implements BasicEntit
      * underlying storage mechanism
      */
     @Id
-    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "groupIdSeq")
     @Column(name = "id")
-    protected Long id;
+    @GeneratedValue(strategy = GenerationType.TABLE, generator = "groupIdGenerator")
+    @TableGenerator(name = "groupIdGenerator", table = "RAVE_SHINDIG_SEQUENCES", pkColumnName = "SEQ_NAME",
+            valueColumnName = "SEQ_COUNT", pkColumnValue = "groups", allocationSize = 1, initialValue = 1)
+    private Long id;
 
     /**
      * Each group has a group name.
      */
     @Basic
     @Column(name = "title")
-    protected String title;
+    private String title;
 
 
     @Basic
     @Column(name = "description")
-    protected String description;
+    private String description;
 
 
     /**
@@ -65,7 +80,7 @@ public class Group implements BasicEntit
      */
     @ManyToOne
     @JoinColumn(name = "owner_id", referencedColumnName = "id")
-    protected Person owner;
+    private Person owner;
 
     /**
      * There are many members of a group.
@@ -76,7 +91,7 @@ public class Group implements BasicEntit
             @JoinColumn(name = "group_id", referencedColumnName = "id"),
             inverseJoinColumns =
             @JoinColumn(name = "person_id", referencedColumnName = "id"))
-    protected List<Person> members;
+    private List<Person> members;
 
     /**
      * @return the owner

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Name.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Name.java?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Name.java (original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Name.java Mon Sep 12 07:24:40 2011
@@ -18,7 +18,9 @@
  */
 package org.apache.rave.opensocial.model;
 
-import javax.persistence.*;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Embeddable;
 
 /**
  * The name object, stored in the name table.

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Organization.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Organization.java?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Organization.java (original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Organization.java Mon Sep 12 07:24:40 2011
@@ -21,14 +21,23 @@ package org.apache.rave.opensocial.model
 import org.apache.rave.persistence.BasicEntity;
 import org.apache.shindig.social.opensocial.model.Address;
 
-import javax.persistence.*;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
 import java.util.Date;
 
 /**
  */
 @Entity
 @Table(name = "organization")
-@SequenceGenerator(name = "organizationIdSeq", sequenceName = "organization_id_seq")
 public class Organization implements org.apache.shindig.social.opensocial.model.Organization, BasicEntity {
 
     /**
@@ -36,8 +45,10 @@ public class Organization implements org
      * underlying storage mechanism
      */
     @Id
-    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "organizationIdSeq")
     @Column(name = "id")
+    @GeneratedValue(strategy = GenerationType.TABLE, generator = "organizationIdGenerator")
+    @TableGenerator(name = "organizationIdGenerator", table = "RAVE_SHINDIG_SEQUENCES", pkColumnName = "SEQ_NAME",
+            valueColumnName = "SEQ_COUNT", pkColumnValue = "organization", allocationSize = 1, initialValue = 1)
     private Long id;
 
     @OneToOne

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Person.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Person.java?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Person.java (original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/Person.java Mon Sep 12 07:24:40 2011
@@ -21,15 +21,39 @@ package org.apache.rave.opensocial.model
 import org.apache.rave.persistence.BasicEntity;
 
 import javax.annotation.Generated;
-import javax.persistence.*;
-import java.util.*;
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Embedded;
+import javax.persistence.Entity;
+import javax.persistence.EnumType;
+import javax.persistence.Enumerated;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * Represents a person in the persistence context
  */
 @Entity
 @Table(name = "person")
-@SequenceGenerator(name="personIdSeq", sequenceName = "person_id_seq")
 @NamedQueries(value = {
     @NamedQuery(name = Person.FIND_BY_USERNAME, query = "select p from Person p where p.username like :username"),
     @NamedQuery(name = Person.FIND_FRIENDS_BY_USERNAME, query = "select a.followed from PersonAssociation a where a.follower.username = :username"),
@@ -44,8 +68,10 @@ public class Person implements BasicEnti
     public static final String USERNAME_PARAM = "username";
 
     @Id
-    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "personIdSeq")
     @Column(name = "id")
+    @GeneratedValue(strategy = GenerationType.TABLE, generator = "personIdGenerator")
+    @TableGenerator(name = "personIdGenerator", table = "RAVE_SHINDIG_SEQUENCES", pkColumnName = "SEQ_NAME",
+            valueColumnName = "SEQ_COUNT", pkColumnValue = "person", allocationSize = 1, initialValue = 1)
     private Long id;
 
     @Basic

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/PersonAssociation.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/PersonAssociation.java?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/PersonAssociation.java (original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/PersonAssociation.java Mon Sep 12 07:24:40 2011
@@ -21,20 +21,31 @@ package org.apache.rave.opensocial.model
 
 import org.apache.rave.persistence.BasicEntity;
 
-import javax.persistence.*;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
+import javax.persistence.UniqueConstraint;
 
 /**
  * Represents an association between people
- *
  */
 @Entity
-@Table(name = "person_association")
-@SequenceGenerator(name="personAssocIdSeq", sequenceName = "person_association_id_seq")
-public class PersonAssociation implements BasicEntity{
+@Table(name = "person_association",
+        uniqueConstraints = @UniqueConstraint(columnNames = {"follower_id", "followed_id"})
+)
+public class PersonAssociation implements BasicEntity {
 
     @Id
-    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "personAssocIdSeq")
     @Column(name = "id")
+    @GeneratedValue(strategy = GenerationType.TABLE, generator = "personAssociationIdGenerator")
+    @TableGenerator(name = "personAssociationIdGenerator", table = "RAVE_SHINDIG_SEQUENCES", pkColumnName = "SEQ_NAME",
+            valueColumnName = "SEQ_COUNT", pkColumnValue = "person_association", allocationSize = 1, initialValue = 1)
     private Long id;
 
     @OneToOne

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/PersonProperty.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/PersonProperty.java?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/PersonProperty.java (original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/rave/opensocial/model/PersonProperty.java Mon Sep 12 07:24:40 2011
@@ -22,8 +22,18 @@ package org.apache.rave.opensocial.model
 import org.apache.rave.persistence.BasicEntity;
 import org.apache.shindig.social.opensocial.model.ListField;
 
-import javax.lang.model.element.TypeElement;
-import javax.persistence.*;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.DiscriminatorColumn;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
 
 /**
  * Defines a property of a person
@@ -33,12 +43,13 @@ import javax.persistence.*;
 @DiscriminatorColumn(name="property_type")
 @DiscriminatorValue("basic")
 @Table(name = "person_property")
-@SequenceGenerator(name="personPropertyIdSeq", sequenceName = "person_property_id_seq")
 public class PersonProperty implements BasicEntity, ListField {
 
     @Id
     @Column(name = "id")
-    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "personPropertyIdSeq")
+    @GeneratedValue(strategy = GenerationType.TABLE, generator = "personPropertyIdGenerator")
+    @TableGenerator(name = "personPropertyIdGenerator", table = "RAVE_SHINDIG_SEQUENCES", pkColumnName = "SEQ_NAME",
+            valueColumnName = "SEQ_COUNT", pkColumnValue = "person_property", allocationSize = 1, initialValue = 1)
     private Long id;
 
     @Basic

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ActivityDb.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ActivityDb.java?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ActivityDb.java (original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ActivityDb.java Mon Sep 12 07:24:40 2011
@@ -23,14 +23,33 @@ import org.apache.shindig.social.opensoc
 import org.apache.shindig.social.opensocial.model.Activity;
 import org.apache.shindig.social.opensocial.model.MediaItem;
 
-import javax.persistence.*;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.MapKey;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
+import javax.persistence.PostLoad;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import javax.persistence.Version;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 
 import static javax.persistence.CascadeType.ALL;
-import static javax.persistence.GenerationType.IDENTITY;
 
 /**
  * Activity model object stored in the "activity" table.
@@ -56,20 +75,21 @@ public class ActivityDb implements Activ
   public static final String JPQL_FINDACTIVITY_BY_FRIENDS = "select a from ActivityDb a where a.userId in (select p.id from PersonDb p where p.objectId in (select f.friend.objectId from PersonDb p, FriendDb f where p.objectId = f.person.objectId and ";
 
   /**
-   * 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.
    */
   @Id
-  @GeneratedValue(strategy = IDENTITY)
   @Column(name = "oid")
-  protected long objectId;
+  @GeneratedValue(strategy = GenerationType.TABLE, generator = "activityIdGenerator")
+  @TableGenerator(name = "activityIdGenerator", table = "RAVE_SHINDIG_SEQUENCES", pkColumnName = "SEQ_NAME",
+          valueColumnName = "SEQ_COUNT", pkColumnValue = "activity", allocationSize = 1, initialValue = 1)
+  private long objectId;
 
   /**
    * An optimistic locking field
    */
   @Version
   @Column(name = "version")
-  protected long version;
+  private long version;
 
   /**
    * model field.
@@ -78,7 +98,7 @@ public class ActivityDb implements Activ
    */
   @Basic
   @Column(name = "app_id", length = 255)
-  protected String appId;
+  private String appId;
 
   /**
    * model field.
@@ -87,7 +107,7 @@ public class ActivityDb implements Activ
    */
   @Basic
   @Column(name = "body", length = 255)
-  protected String body;
+  private String body;
 
   /**
    * model field.
@@ -96,7 +116,7 @@ public class ActivityDb implements Activ
    */
   @Basic
   @Column(name = "body_id", length = 255)
-  protected String bodyId;
+  private String bodyId;
 
   /**
    * model field.
@@ -105,7 +125,7 @@ public class ActivityDb implements Activ
    */
   @Basic
   @Column(name = "external_id", length = 255)
-  protected String externalId;
+  private String externalId;
 
   /**
    * model field.
@@ -114,7 +134,7 @@ public class ActivityDb implements Activ
    */
   @Basic
   @Column(name = "activity_id", length = 255)
-  protected String id;
+  private String id;
 
   /**
    * model field.
@@ -124,7 +144,7 @@ public class ActivityDb implements Activ
   @Basic
   @Column(name = "updated")
   @Temporal(TemporalType.TIMESTAMP)
-  protected Date updated;
+  private Date updated;
 
   /**
    * A list of shared media items associated with this activity, joined by the
@@ -136,7 +156,7 @@ public class ActivityDb implements Activ
   @JoinTable(name = "activity_media",
       joinColumns = @JoinColumn(name = "activity_id", referencedColumnName = "oid"),
       inverseJoinColumns = @JoinColumn(name = "media_id", referencedColumnName = "oid"))
-  protected List<MediaItem> mediaItems;
+  private List<MediaItem> mediaItems;
 
   /**
    * model field.
@@ -145,7 +165,7 @@ public class ActivityDb implements Activ
    */
   @Basic
   @Column(name = "posted_time")
-  protected Long postedTime;
+  private Long postedTime;
 
   /**
    * model field.
@@ -154,7 +174,7 @@ public class ActivityDb implements Activ
    */
   @Basic
   @Column(name = "priority")
-  protected Float priority;
+  private Float priority;
 
   /**
    * model field.
@@ -163,7 +183,7 @@ public class ActivityDb implements Activ
    */
   @Basic
   @Column(name = "stream_favicon_url", length = 255)
-  protected String streamFaviconUrl;
+  private String streamFaviconUrl;
 
   /**
    * model field.
@@ -172,7 +192,7 @@ public class ActivityDb implements Activ
    */
   @Basic
   @Column(name = "stream_source_url", length = 255)
-  protected String streamSourceUrl;
+  private String streamSourceUrl;
 
   /**
    * model field.
@@ -181,7 +201,7 @@ public class ActivityDb implements Activ
    */
   @Basic
   @Column(name = "stream_title", length = 255)
-  protected String streamTitle;
+  private String streamTitle;
 
   /**
    * model field.
@@ -190,7 +210,7 @@ public class ActivityDb implements Activ
    */
   @Basic
   @Column(name = "stream_url", length = 255)
-  protected String streamUrl;
+  private String streamUrl;
 
   /**
    * Create map using ActivityTemplateParamsDb such that ActivityTemplateParams
@@ -200,14 +220,14 @@ public class ActivityDb implements Activ
    */
   @OneToMany(targetEntity = ActivityTemplateParamsDb.class, mappedBy = "activity", cascade = ALL)
   @MapKey(name = "name")
-  protected Map<String, ActivityTemplateParamsDb> templateParamsDb = new MapMaker().makeMap();
+  private Map<String, ActivityTemplateParamsDb> templateParamsDb = new MapMaker().makeMap();
 
   /**
    * The transient store for templateParamers loaded by the postLoad hook and
    * persisted by the prePersist hook.
    */
   @Transient
-  protected Map<String, String> templateParams;
+  private Map<String, String> templateParams;
 
   /**
    * model field.
@@ -216,7 +236,7 @@ public class ActivityDb implements Activ
    */
   @Basic
   @Column(name = "title", length = 255)
-  protected String title;
+  private String title;
 
   /**
    * model field.
@@ -225,7 +245,7 @@ public class ActivityDb implements Activ
    */
   @Basic
   @Column(name = "title_id", length = 255)
-  protected String titleId;
+  private String titleId;
 
   /**
    * model field.
@@ -234,7 +254,7 @@ public class ActivityDb implements Activ
    */
   @Basic
   @Column(name = "url", length = 255)
-  protected String url;
+  private String url;
 
   /**
    * model field.
@@ -243,7 +263,7 @@ public class ActivityDb implements Activ
    */
   @Basic
   @Column(name = "user_id", length = 255)
-  protected String userId;
+  private String userId;
 
   public ActivityDb() {
   }
@@ -599,7 +619,9 @@ public class ActivityDb implements Activ
    */
   @PrePersist
   public void populateDbFields() {
-    if (templateParams != null) {
+      if (templateParams == null) {
+          return;
+      }
       // add new entries
       for (Entry<String, String> e : templateParams.entrySet()) {
         ActivityTemplateParamsDb a = templateParamsDb.get(e.getKey());
@@ -608,8 +630,6 @@ public class ActivityDb implements Activ
           a.name = e.getKey();
           a.value = e.getValue();
           a.activity = this;
-          // a.activities = Lists.newArrayList();
-          // a.activities.add(this);
           templateParamsDb.put(e.getKey(), a);
         } else {
           a.value = e.getValue();
@@ -626,7 +646,6 @@ public class ActivityDb implements Activ
       for (String r : toRemove) {
         templateParamsDb.remove(r);
       }
-    }
   }
 
   /**

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ActivityTemplateParamsDb.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ActivityTemplateParamsDb.java?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ActivityTemplateParamsDb.java (original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ActivityTemplateParamsDb.java Mon Sep 12 07:24:40 2011
@@ -20,10 +20,19 @@ package org.apache.shindig.social.openso
 import org.apache.shindig.social.opensocial.jpa.api.DbObject;
 import org.apache.shindig.social.opensocial.model.Activity;
 
-import javax.persistence.*;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
+import javax.persistence.Version;
 
 import static javax.persistence.CascadeType.ALL;
-import static javax.persistence.GenerationType.IDENTITY;
 
 /**
  *
@@ -31,13 +40,15 @@ import static javax.persistence.Generati
 @Entity
 @Table(name = "template_params")
 public class ActivityTemplateParamsDb implements DbObject {
+    
   /**
-   * 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.
    */
   @Id
-  @GeneratedValue(strategy = IDENTITY)
   @Column(name = "oid")
+  @GeneratedValue(strategy = GenerationType.TABLE, generator = "activityTemplateParamsIdGenerator")
+  @TableGenerator(name = "activityTemplateParamsIdGenerator", table = "RAVE_SHINDIG_SEQUENCES", pkColumnName = "SEQ_NAME",
+          valueColumnName = "SEQ_COUNT", pkColumnValue = "template_params", allocationSize = 1, initialValue = 1)
   protected long objectId;
 
   /**

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ApplicationDataMapDb.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ApplicationDataMapDb.java?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ApplicationDataMapDb.java (original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ApplicationDataMapDb.java Mon Sep 12 07:24:40 2011
@@ -21,13 +21,27 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.MapMaker;
 import org.apache.shindig.social.opensocial.jpa.api.DbObject;
 
-import javax.persistence.*;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.MapKey;
+import javax.persistence.OneToMany;
+import javax.persistence.PostLoad;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
+import javax.persistence.Transient;
+import javax.persistence.Version;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 
 import static javax.persistence.CascadeType.ALL;
-import static javax.persistence.GenerationType.IDENTITY;
 
 
 /**
@@ -54,16 +68,18 @@ public class ApplicationDataMapDb implem
    * underlying storage mechanism
    */
   @Id
-  @GeneratedValue(strategy = IDENTITY)
   @Column(name = "oid")
-  protected long objectId;
+  @GeneratedValue(strategy = GenerationType.TABLE, generator = "applicationDataMapIdGenerator")
+  @TableGenerator(name = "applicationDataMapIdGenerator", table = "RAVE_SHINDIG_SEQUENCES", pkColumnName = "SEQ_NAME",
+          valueColumnName = "SEQ_COUNT", pkColumnValue = "application_datamap", allocationSize = 1, initialValue = 1)
+  private long objectId;
 
   /**
    * An optimistic locking field.
    */
   @Version
   @Column(name = "version")
-  protected long version;
+  private long version;
 
   /**
    * A Application Data Map belongs to a set of maps associated with an application.
@@ -71,7 +87,7 @@ public class ApplicationDataMapDb implem
    */
   @ManyToOne(targetEntity=ApplicationDb.class)
   @JoinColumn(name="application_id", referencedColumnName="oid")
-  protected ApplicationDb application;
+  private ApplicationDb application;
 
   /**
    * Create map using ApplicationDataMapValueDb such that ApplicationDataMapDb are joined on oid ->
@@ -81,18 +97,18 @@ public class ApplicationDataMapDb implem
    */
   @OneToMany(targetEntity=ApplicationDataMapValueDb.class, mappedBy="applicationDataMap", cascade = ALL)
   @MapKey(name="name")
-  protected Map<String, ApplicationDataMapValueDb> valuesDb = new MapMaker().makeMap();
+  private Map<String, ApplicationDataMapValueDb> valuesDb = new MapMaker().makeMap();
 
   /**
    * The transient store for values loaded by the postLoad hook and persisted by the
    * prePersist hook.
    */
   @Transient
-  protected Map<String, String> values;
+  private Map<String, String> values;
 
   @Basic
   @Column(name="person_id", length=255)
-  protected String personId;
+  private String personId;
 
   /**
    * persist the state of object before sending to the db.
@@ -104,12 +120,12 @@ public class ApplicationDataMapDb implem
       ApplicationDataMapValueDb a = valuesDb.get(e.getKey());
       if (a == null) {
         a = new ApplicationDataMapValueDb();
-        a.name = e.getKey();
-        a.value = e.getValue();
-        a.applicationDataMap = this;
+        a.setName(e.getKey());
+        a.setValue(e.getValue());
+        a.setApplicationDataMap(this);
         valuesDb.put(e.getKey(), a);
       } else {
-        a.value = e.getValue();
+        a.setValue(e.getValue());
       }
     }
     // remove old entries
@@ -131,7 +147,7 @@ public class ApplicationDataMapDb implem
   public void postLoad() {
     values = new MapMaker().makeMap();
     for (Entry<String, ApplicationDataMapValueDb> e : valuesDb.entrySet()) {
-      values.put(e.getKey(), e.getValue().value);
+      values.put(e.getKey(), e.getValue().getValue());
     }
   }
 
@@ -143,7 +159,7 @@ public class ApplicationDataMapDb implem
   }
 
   /**
-   * @param applicationData the applicationData to set
+   * @param application the application to set
    */
   public void setApplication(ApplicationDb application) {
     this.application = application;

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ApplicationDataMapValueDb.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ApplicationDataMapValueDb.java?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ApplicationDataMapValueDb.java (original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ApplicationDataMapValueDb.java Mon Sep 12 07:24:40 2011
@@ -19,9 +19,17 @@ package org.apache.shindig.social.openso
 
 import org.apache.shindig.social.opensocial.jpa.api.DbObject;
 
-import javax.persistence.*;
-
-import static javax.persistence.GenerationType.IDENTITY;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
+import javax.persistence.Version;
 
 /**
  * The final storage of data in the application datamap. Values are limited here to 4K in size.
@@ -29,42 +37,44 @@ import static javax.persistence.Generati
 @Entity
 @Table(name="application_datavalue")
 public class ApplicationDataMapValueDb implements DbObject {
+
   /**
-   * 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
    */
   @Id
-  @GeneratedValue(strategy = IDENTITY)
   @Column(name = "oid")
-  protected long objectId;
+  @GeneratedValue(strategy = GenerationType.TABLE, generator = "applicationDataMapValueIdGenerator")
+  @TableGenerator(name = "applicationDataMapValueIdGenerator", table = "RAVE_SHINDIG_SEQUENCES", pkColumnName = "SEQ_NAME",
+          valueColumnName = "SEQ_COUNT", pkColumnValue = "application_datavalue", allocationSize = 1, initialValue = 1)
+  private long objectId;
 
   /**
    * An optimistic locking field.
    */
   @Version
   @Column(name = "version")
-  protected long version;
+  private long version;
 
   /**
    * Each entry is associated with an application Data Map
    */
   @ManyToOne(targetEntity=ApplicationDataMapDb.class)
   @JoinColumn(name="application_datamap_id", referencedColumnName="oid")
-  protected ApplicationDataMapDb applicationDataMap;
+  private ApplicationDataMapDb applicationDataMap;
   
   /**
    * Each entry has a name
    */
   @Basic
   @Column(name="name", length=255)
-  protected String name;
+  private String name;
   
   /**
    * Each entry has a value (4K limit to size)
    */
   @Basic
   @Column(name="value", length=4094)
-  protected String value;
+  private String value;
 
   /**
    * @return the applicationDataMap

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ApplicationDb.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ApplicationDb.java?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ApplicationDb.java (original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ApplicationDb.java Mon Sep 12 07:24:40 2011
@@ -20,32 +20,42 @@ package org.apache.shindig.social.openso
 import org.apache.shindig.social.opensocial.jpa.api.DbObject;
 import org.apache.shindig.social.opensocial.model.ListField;
 
-import javax.persistence.*;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.MapKey;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
+import javax.persistence.Version;
 import java.util.Map;
 
-import static javax.persistence.GenerationType.IDENTITY;
-
 /**
  * Stores information about applications
  */
 @Entity
 @Table(name = "application")
 public class ApplicationDb implements DbObject {
+
   /**
-   * 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.
    */
   @Id
-  @GeneratedValue(strategy = IDENTITY)
   @Column(name = "oid")
-  protected long objectId;
+  @GeneratedValue(strategy = GenerationType.TABLE, generator = "applicationIdGenerator")
+  @TableGenerator(name = "applicationIdGenerator", table = "RAVE_SHINDIG_SEQUENCES", pkColumnName = "SEQ_NAME",
+          valueColumnName = "SEQ_COUNT", pkColumnValue = "application", allocationSize = 1, initialValue = 1)
+  private long objectId;
 
   /**
    * An optimistic locking field.
    */
   @Version
   @Column(name = "version")
-  protected long version;
+  private long version;
 
 
   /**
@@ -53,15 +63,15 @@ public class ApplicationDb implements Db
    */
   @OneToMany(targetEntity = ApplicationPropertyDb.class, mappedBy = "application")
   @MapKey(name = "type")
-  protected Map<String, ListField> properties;
+  private Map<String, ListField> properties;
 
 
   /**
    * Each Application has an Id
    */
   @Basic
-  @Column(name = "id", length = 255)
-  protected String id;
+  @Column(name = "application_id", length = 255)
+  private String applicationId;
 
 
   /**
@@ -81,18 +91,18 @@ public class ApplicationDb implements Db
 
 
   /**
-   * @return the id
+   * @return the id of the application
    */
-  public String getId() {
-    return id;
+  public String getApplicationId() {
+    return applicationId;
   }
 
 
   /**
-   * @param id the id to set
+   * @param applicationId the id of the application to set
    */
-  public void setId(String id) {
-    this.id = id;
+  public void setApplicationId(String applicationId) {
+    this.applicationId = applicationId;
   }
 
 

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ApplicationPropertyDb.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ApplicationPropertyDb.java?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ApplicationPropertyDb.java (original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ApplicationPropertyDb.java Mon Sep 12 07:24:40 2011
@@ -17,7 +17,11 @@
  */
 package org.apache.shindig.social.opensocial.jpa;
 
-import javax.persistence.*;
+import javax.persistence.Entity;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.PrimaryKeyJoinColumn;
+import javax.persistence.Table;
 
 /**
  * This is a property of an application, extending the listfield type, and using the type property
@@ -33,7 +37,7 @@ public class ApplicationPropertyDb exten
    */
   @ManyToOne(targetEntity = ApplicationDb.class)
   @JoinColumn(name = "application_id", referencedColumnName = "oid")
-  protected ApplicationDb application;
+  private ApplicationDb application;
 
   /**
    * @return the application

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/EnumDb.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/EnumDb.java?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/EnumDb.java (original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/EnumDb.java Mon Sep 12 07:24:40 2011
@@ -51,7 +51,6 @@ public final class EnumDb<E extends Enum
 
   /** 
    * {@inheritDoc}
-   * @see org.apache.shindig.social.opensocial.model.Enum#getDisplayValue()
    */
   public String getDisplayValue() {
     return displayValue;
@@ -59,7 +58,6 @@ public final class EnumDb<E extends Enum
 
   /** 
    * {@inheritDoc}
-   * @see org.apache.shindig.social.opensocial.model.Enum#setDisplayValue(java.lang.String)
    */
   public void setDisplayValue(String displayValue) {
     this.displayValue = displayValue;
@@ -67,7 +65,6 @@ public final class EnumDb<E extends Enum
 
   /** 
    * {@inheritDoc}
-   * @see org.apache.shindig.social.opensocial.model.Enum#getValue()
    */
   public E getValue() {
     return value;
@@ -75,7 +72,6 @@ public final class EnumDb<E extends Enum
 
   /** 
    * {@inheritDoc}
-   * @see org.apache.shindig.social.opensocial.model.Enum#setValue(org.apache.shindig.social.opensocial.model.Enum.EnumKey)
    */
   public void setValue(E value) {
     this.value = value;

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ListFieldDb.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ListFieldDb.java?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ListFieldDb.java (original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/ListFieldDb.java Mon Sep 12 07:24:40 2011
@@ -20,9 +20,19 @@ package org.apache.shindig.social.openso
 import org.apache.shindig.social.opensocial.jpa.api.DbObject;
 import org.apache.shindig.social.opensocial.model.ListField;
 
-import javax.persistence.*;
-
-import static javax.persistence.GenerationType.IDENTITY;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.DiscriminatorColumn;
+import javax.persistence.DiscriminatorType;
+import javax.persistence.DiscriminatorValue;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import javax.persistence.MappedSuperclass;
+import javax.persistence.TableGenerator;
+import javax.persistence.Version;
 
 /**
  * List fields represent storage of list of fields potentially with a preferred or primary value.
@@ -31,26 +41,27 @@ import static javax.persistence.Generati
  * class represented by the record. If there is no type it defaults to ListFieldDb.
  */
 @MappedSuperclass
-//@Table(name="list_field")
 @Inheritance(strategy=InheritanceType.JOINED)
 @DiscriminatorColumn(name="list_field_type", length=30, discriminatorType=DiscriminatorType.STRING)
 @DiscriminatorValue(value="ListFieldDb")
-public class ListFieldDb implements ListField, DbObject {
+public abstract class ListFieldDb implements ListField, DbObject {
   /**
    * The internal object ID used for references to this object. Should be generated 
    * by the underlying storage mechanism
    */
   @Id
-  @GeneratedValue(strategy=IDENTITY)
   @Column(name="oid")
-  protected long objectId;
+  @GeneratedValue(strategy = GenerationType.TABLE, generator = "listFieldIdGenerator")
+  @TableGenerator(name = "listFieldIdGenerator", table = "RAVE_SHINDIG_SEQUENCES", pkColumnName = "SEQ_NAME",
+          valueColumnName = "SEQ_COUNT", pkColumnValue = "list_field", allocationSize = 1, initialValue = 1)
+  private long objectId;
   
   /**
    * An optimistic locking field.
    */
   @Version
   @Column(name="version")
-  protected long version;
+  private long version;
 
   
   /**
@@ -59,7 +70,7 @@ public class ListFieldDb implements List
    */
   @Basic
   @Column(name="field_type", length=255)
-  protected String type;
+  private String type;
   
   /**
    * model field.
@@ -67,7 +78,7 @@ public class ListFieldDb implements List
    */
   @Basic
   @Column(name="field_value", length=255)
-  protected String value;
+  private String value;
   
   /**
    * model field.
@@ -75,7 +86,7 @@ public class ListFieldDb implements List
    */
   @Basic
   @Column(name="primary_field")
-  protected Boolean primary;
+  private Boolean primary;
 
   /**
    * Create a list field.

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/MediaItemDb.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/MediaItemDb.java?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/MediaItemDb.java (original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/MediaItemDb.java Mon Sep 12 07:24:40 2011
@@ -22,12 +22,21 @@ import org.apache.shindig.social.opensoc
 import org.apache.shindig.social.opensocial.model.Address;
 import org.apache.shindig.social.opensocial.model.MediaItem;
 
-import javax.persistence.*;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.ManyToMany;
+import javax.persistence.PostLoad;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
+import javax.persistence.Transient;
+import javax.persistence.Version;
 import java.util.List;
 
-import static javax.persistence.CascadeType.*;
-import static javax.persistence.GenerationType.IDENTITY;
-
 /**
  * Media items are stored in the media_item table, Items may be shared amongst activities and are
  * related to people.
@@ -35,547 +44,580 @@ import static javax.persistence.Generati
 @Entity
 @Table(name = "media_item")
 public class MediaItemDb implements MediaItem, DbObject {
-  /**
-   * The internal object ID used for references to this object. Should be generated
-   * by the underlying storage mechanism
-   */
-  @Id
-  @GeneratedValue(strategy = IDENTITY)
-  @Column(name = "oid")
-  private long objectId;
-
-  /**
-   * An optimistic locking field
-   */
-  @Version
-  @Column(name = "version")
-  protected long version;
-
-  /**
-   * The list of activities which this media item is reference in, this relationship is specified by
-   * the java property mediaItems in the class ActivityDb.
-   *
-   * @see ActivityDb for more information on this mapping.
-   */
-  @ManyToMany(targetEntity = ActivityDb.class, mappedBy = "mediaItems")
-  protected List<Activity> activities;
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "mime_type", length = 255)
-  private String mimeType;
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "media_type")
-  private String typeDb;
-
-  /**
-   * model field
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "thumbnail_url", length = 255)
-  private String thumbnailUrl;
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Transient
-  private Type type;
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "url", length = 255)
-  private String url;
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "album_id")
-  private String albumId;
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "created")
-  private String created;
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "description")
-  private String description;
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "title")
-  private String title;
-
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "duration")
-  private String duration;
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "file_size")
-  private String fileSize;
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "id")
-  private String id;
-
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "language")
-  private String language;
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "last_updated")
-  private String lastUpdated;
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Transient
-  private Address location;
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "num_comments")
-  private String numComments;
-
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "num_views")
-  private String numViews;
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "num_votes")
-  private String numVotes;
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "rating")
-  private String rating;
-
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "start_time")
-  private String startTime;
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "tagged_people")
-  private String taggedPeople;
-
-  /**
-   * model field.
-   * @see org.apache.shindig.social.opensocial.model.MediaItem
-   */
-  @Basic
-  @Column(name = "tags")
-  private String tags;
-
-  /**
-   * Create a new blank media item.
-   */
-  public MediaItemDb() {
-  }
-
-  /**
-   * Create a media item specifying the mimeType, type and url.
-   * @param mimeType the mime type of the media item.
-   * @param type the type of the media items (see the specification)
-   * @param url the url pointing to the media item.
-   */
-  public MediaItemDb(String mimeType, Type type, String url) {
-    this.mimeType = mimeType;
-    this.type = type;
-    this.url = url;
-  }
-
-  /**
-   * {@inheritDoc}
-   * @see org.apache.shindig.social.opensocial.model.MediaItem#getMimeType()
-   */
-  public String getMimeType() {
-    return mimeType;
-  }
-
-  /**
-   * {@inheritDoc}
-   * @see org.apache.shindig.social.opensocial.model.MediaItem#setMimeType(java.lang.String)
-   */
-  public void setMimeType(String mimeType) {
-    this.mimeType = mimeType;
-  }
-
-  /**
-   * {@inheritDoc}
-   * @see org.apache.shindig.social.opensocial.model.MediaItem#getType()
-   */
-  public Type getType() {
-    return type;
-  }
-
-  /**
-   * {@inheritDoc}
-   * @see org.apache.shindig.social.opensocial.model.MediaItem#setType(org.apache.shindig.social.opensocial.model.MediaItem.Type)
-   */
-  public void setType(Type type) {
-    this.type = type;
-  }
-
-  /**
-   * {@inheritDoc}
-   * @see org.apache.shindig.social.opensocial.model.MediaItem#getUrl()
-   */
-  public String getUrl() {
-    return url;
-  }
-
-  /**
-   * {@inheritDoc}
-   * @see org.apache.shindig.social.opensocial.model.MediaItem#setUrl(java.lang.String)
-   */
-  public void setUrl(String url) {
-    this.url = url;
-  }
-
-  /**
-   * {@inheritDoc}
-   * @see org.apache.shindig.social.opensocial.model.MediaItem#getThumbnailUrl()
-   */
-  public String getThumbnailUrl() {
-    return thumbnailUrl;
-  }
-
-  /**
-   * {@inheritDoc}
-   * @see org.apache.shindig.social.opensocial.model.MediaItem#setThumbnailUrl(java.lang.String)
-   */
-  public void setThumbnailUrl(String url) {
-    this.thumbnailUrl = url;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String getAlbumId() {
-    return albumId;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setAlbumId(String albumId) {
-    this.albumId = albumId;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String getCreated() {
-    return created;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setCreated(String created) {
-    this.created = created;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String getDescription() {
-    return description;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setDescription(String description) {
-    this.description = description;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String getDuration() {
-    return duration;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setDuration(String duration) {
-    this.duration = duration;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String getFileSize() {
-    return fileSize;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setFileSize(String fileSize) {
-    this.fileSize = fileSize;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String getId() {
-    return id;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setId(String id) {
-    this.id = id;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String getLanguage() {
-    return language;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setLanguage(String language) {
-    this.language = language;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String getLastUpdated() {
-    return lastUpdated;
-  }
-
-  public void setLastUpdated(String lastUpdated) {
-    this.lastUpdated = lastUpdated;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public Address getLocation() {
-    return location;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setLocation(Address location) {
-    this.location = location;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String getNumComments() {
-    return numComments;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setNumComments(String numComments) {
-    this.numComments = numComments;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String getNumViews() {
-    return numViews;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setNumViews(String numViews) {
-    this.numViews = numViews;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String getNumVotes() {
-    return numVotes;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setNumVotes(String numVotes) {
-    this.numVotes = numVotes;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String getRating() {
-    return rating;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setRating(String rating) {
-    this.rating = rating;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String getStartTime() {
-    return startTime;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setStartTime(String startTime) {
-    this.startTime = startTime;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String getTaggedPeople() {
-    return taggedPeople;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setTaggedPeople(String taggedPeople) {
-    this.taggedPeople = taggedPeople;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String getTags() {
-    return tags;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setTags(String tags) {
-    this.tags = tags;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public String getTitle() {
-    return title;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public void setTitle(String title) {
-    this.title = title;
-  }
-
-  /**
-   * {@inheritDoc}
-   * @see org.apache.shindig.social.opensocial.jpa.api.DbObject#getObjectId()
-   */
-  public long getObjectId() {
-    return objectId;
-  }
-
-  /**
-   * a hook into the pre persist phase of JPA to convert type into the db representation.
-   */
-  @PrePersist
-  public void populateDbFields() {
-    typeDb = type.toString();
-  }
-
-  /**
-   * A hook into the load to convert the type in the Db into the Type Enum.
-   */
-  @PostLoad
-  public void loadTransientFields() {
-    type = Type.valueOf(typeDb);
-  }
+    /**
+     * The internal object ID used for references to this object.
+     */
+    @Id
+    @Column(name = "oid")
+    @GeneratedValue(strategy = GenerationType.TABLE, generator = "mediaItemIdGenerator")
+    @TableGenerator(name = "mediaItemIdGenerator", table = "RAVE_SHINDIG_SEQUENCES", pkColumnName = "SEQ_NAME",
+            valueColumnName = "SEQ_COUNT", pkColumnValue = "media_item", allocationSize = 1, initialValue = 1)
+    private long objectId;
+
+    /**
+     * An optimistic locking field
+     */
+    @Version
+    @Column(name = "version")
+    private long version;
+
+    /**
+     * The list of activities which this media item is reference in, this relationship is specified by
+     * the java property mediaItems in the class ActivityDb.
+     *
+     * @see ActivityDb for more information on this mapping.
+     */
+    @ManyToMany(targetEntity = ActivityDb.class, mappedBy = "mediaItems")
+    private List<Activity> activities;
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "mime_type", length = 255)
+    private String mimeType;
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "media_type")
+    private String typeDb;
+
+    /**
+     * model field
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "thumbnail_url", length = 255)
+    private String thumbnailUrl;
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Transient
+    private Type type;
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "url", length = 255)
+    private String url;
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "album_id")
+    private String albumId;
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "created")
+    private String created;
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "description")
+    private String description;
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "title")
+    private String title;
+
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "duration")
+    private String duration;
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "file_size")
+    private String fileSize;
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "media_item_id")
+    private String id;
+
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "language")
+    private String language;
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "last_updated")
+    private String lastUpdated;
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Transient
+    private Address location;
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "num_comments")
+    private String numComments;
+
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "num_views")
+    private String numViews;
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "num_votes")
+    private String numVotes;
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "rating")
+    private String rating;
+
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "start_time")
+    private String startTime;
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "tagged_people")
+    private String taggedPeople;
+
+    /**
+     * model field.
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem
+     */
+    @Basic
+    @Column(name = "tags")
+    private String tags;
+
+    /**
+     * Create a new blank media item.
+     */
+    public MediaItemDb() {
+    }
+
+    /**
+     * Create a media item specifying the mimeType, type and url.
+     *
+     * @param mimeType the mime type of the media item.
+     * @param type     the type of the media items (see the specification)
+     * @param url      the url pointing to the media item.
+     */
+    public MediaItemDb(String mimeType, Type type, String url) {
+        this.mimeType = mimeType;
+        this.type = type;
+        this.url = url;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem#getMimeType()
+     */
+    public String getMimeType() {
+        return mimeType;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem#setMimeType(java.lang.String)
+     */
+    public void setMimeType(String mimeType) {
+        this.mimeType = mimeType;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem#getType()
+     */
+    public Type getType() {
+        return type;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem#setType(org.apache.shindig.social.opensocial.model.MediaItem.Type)
+     */
+    public void setType(Type type) {
+        this.type = type;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem#getUrl()
+     */
+    public String getUrl() {
+        return url;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem#setUrl(java.lang.String)
+     */
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem#getThumbnailUrl()
+     */
+    public String getThumbnailUrl() {
+        return thumbnailUrl;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @see org.apache.shindig.social.opensocial.model.MediaItem#setThumbnailUrl(java.lang.String)
+     */
+    public void setThumbnailUrl(String url) {
+        this.thumbnailUrl = url;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getAlbumId() {
+        return albumId;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setAlbumId(String albumId) {
+        this.albumId = albumId;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getCreated() {
+        return created;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setCreated(String created) {
+        this.created = created;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getDuration() {
+        return duration;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setDuration(String duration) {
+        this.duration = duration;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getFileSize() {
+        return fileSize;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setFileSize(String fileSize) {
+        this.fileSize = fileSize;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getLanguage() {
+        return language;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setLanguage(String language) {
+        this.language = language;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getLastUpdated() {
+        return lastUpdated;
+    }
+
+    public void setLastUpdated(String lastUpdated) {
+        this.lastUpdated = lastUpdated;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public Address getLocation() {
+        return location;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setLocation(Address location) {
+        this.location = location;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getNumComments() {
+        return numComments;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setNumComments(String numComments) {
+        this.numComments = numComments;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getNumViews() {
+        return numViews;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setNumViews(String numViews) {
+        this.numViews = numViews;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getNumVotes() {
+        return numVotes;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setNumVotes(String numVotes) {
+        this.numVotes = numVotes;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getRating() {
+        return rating;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setRating(String rating) {
+        this.rating = rating;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getStartTime() {
+        return startTime;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getTaggedPeople() {
+        return taggedPeople;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setTaggedPeople(String taggedPeople) {
+        this.taggedPeople = taggedPeople;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getTags() {
+        return tags;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setTags(String tags) {
+        this.tags = tags;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getTitle() {
+        return title;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    /**
+     * {@inheritDoc}
+     *
+     * @see org.apache.shindig.social.opensocial.jpa.api.DbObject#getObjectId()
+     */
+    public long getObjectId() {
+        return objectId;
+    }
+
+    /**
+     * a hook into the pre persist phase of JPA to convert type into the db representation.
+     */
+    @PrePersist
+    public void populateDbFields() {
+        typeDb = type.toString();
+    }
+
+    /**
+     * A hook into the load to convert the type in the Db into the Type Enum.
+     */
+    @PostLoad
+    public void loadTransientFields() {
+        type = Type.valueOf(typeDb);
+    }
 }

Modified: incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/MessageDb.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/MessageDb.java?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/MessageDb.java (original)
+++ incubator/rave/trunk/rave-shindig/src/main/java/org/apache/shindig/social/opensocial/jpa/MessageDb.java Mon Sep 12 07:24:40 2011
@@ -21,12 +21,21 @@ import org.apache.shindig.social.opensoc
 import org.apache.shindig.social.opensocial.model.Message;
 import org.apache.shindig.social.opensocial.model.Url;
 
-import javax.persistence.*;
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.PostLoad;
+import javax.persistence.PrePersist;
+import javax.persistence.Table;
+import javax.persistence.TableGenerator;
+import javax.persistence.Transient;
+import javax.persistence.Version;
 import java.util.Date;
 import java.util.List;
 
-import static javax.persistence.GenerationType.IDENTITY;
-
 /**
  * Messages are stored in the message table.
  */
@@ -38,16 +47,18 @@ public class MessageDb implements Messag
    * by the underlying storage mechanism
    */
   @Id
-  @GeneratedValue(strategy=IDENTITY)
   @Column(name="oid")
-  protected long objectId;
+  @GeneratedValue(strategy = GenerationType.TABLE, generator = "messageIdGenerator")
+  @TableGenerator(name = "messageIdGenerator", table = "RAVE_SHINDIG_SEQUENCES", pkColumnName = "SEQ_NAME",
+          valueColumnName = "SEQ_COUNT", pkColumnValue = "message", allocationSize = 1, initialValue = 1)
+  private long objectId;
 
   /**
    * An optimistic locking field
    */
   @Version
   @Column(name="version")
-  protected long version;
+  private long version;
 
   /**
    * model field.
@@ -55,7 +66,7 @@ public class MessageDb implements Messag
    */
   @Basic
   @Column(name="body", length=255)
-  protected String body;
+  private String body;
 
   /**
    * model field.
@@ -63,7 +74,7 @@ public class MessageDb implements Messag
    */
   @Basic
   @Column(name="title", length=255)
-  protected String title;
+  private String title;
 
   /**
    * model field. (database representation of type)
@@ -71,14 +82,14 @@ public class MessageDb implements Messag
    */
   @Basic
   @Column(name="message_type")
-  protected String typeDb;
+  private String typeDb;
 
   /**
    * model field.
    * @see org.apache.shindig.social.opensocial.model.Message
    */
   @Transient
-  protected Type type;
+  private Type type;
 
   /**
    * create an empty message.

Modified: incubator/rave/trunk/rave-shindig/src/main/resources/initial_data.sql
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/main/resources/initial_data.sql?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/main/resources/initial_data.sql (original)
+++ incubator/rave/trunk/rave-shindig/src/main/resources/initial_data.sql Mon Sep 12 07:24:40 2011
@@ -15,35 +15,70 @@
  -- specific language governing permissions and limitations
  -- under the License.
 
+set @token_info_seq = 'token_info';
+set @oauth_consumer_store_seq = 'oauth_consumer_store';
+set @person_seq = 'person';
+set @person_association_seq = 'person_association';
+set @groups_seq = 'groups';
+set @group_members_seq = 'group_members';
+
+CREATE TABLE IF NOT EXISTS RAVE_SHINDIG_SEQUENCES (seq_name VARCHAR(255) PRIMARY KEY NOT NULL, seq_count BIGINT(19));
+INSERT INTO RAVE_SHINDIG_SEQUENCES(seq_name, seq_count) values (@token_info_seq, 1);
+INSERT INTO RAVE_SHINDIG_SEQUENCES(seq_name, seq_count) values (@oauth_consumer_store_seq, 1);
+INSERT INTO RAVE_SHINDIG_SEQUENCES(seq_name, seq_count) values (@person_seq, 1);
+INSERT INTO RAVE_SHINDIG_SEQUENCES(seq_name, seq_count) values (@person_association_seq, 1);
+INSERT INTO RAVE_SHINDIG_SEQUENCES(seq_name, seq_count) values (@groups_seq, 1);
+INSERT INTO RAVE_SHINDIG_SEQUENCES(seq_name, seq_count) values (@group_members_seq, 1);
+
+set @person_id_1 = (SELECT seq_count FROM RAVE_SHINDIG_SEQUENCES WHERE seq_name = @person_seq);
 INSERT INTO person(id, username, display_name, gender, status, profile_url, build, eye_color, hair_color,family_name, given_name )
-VALUES (set(@person_id_1, next value for person_id_seq), 'canonical', 'Canonical User', 'male', 'I am alive', 'http://rave.rocks.org/profile', 'skinny', 'orange', 'blue', 'User', 'Canonical');
+VALUES (@person_id_1, 'canonical', 'Canonical User', 'male', 'I am alive', 'http://rave.rocks.org/profile', 'skinny', 'orange', 'blue', 'User', 'Canonical');
+UPDATE RAVE_SHINDIG_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @person_seq;
 
+set @person_id_2 = (SELECT seq_count FROM RAVE_SHINDIG_SEQUENCES WHERE seq_name = @person_seq);
 INSERT INTO person(id, username, display_name, gender)
-VALUES (set(@person_id_2, next value for person_id_seq), 'john.doe', 'John Doe', 'male');
+VALUES (@person_id_2, 'john.doe', 'John Doe', 'male');
+UPDATE RAVE_SHINDIG_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @person_seq;
 
+set @person_id_3 = (SELECT seq_count FROM RAVE_SHINDIG_SEQUENCES WHERE seq_name = @person_seq);
 INSERT INTO person(id, username, display_name, gender)
-VALUES (set(@person_id_3, next value for person_id_seq), 'jane.doe', 'Jane Doe', 'female');
+VALUES (@person_id_3, 'jane.doe', 'Jane Doe', 'female');
+UPDATE RAVE_SHINDIG_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @person_seq;
 
+set @person_id_4 = (SELECT seq_count FROM RAVE_SHINDIG_SEQUENCES WHERE seq_name = @person_seq);
 INSERT INTO person(id, username, display_name)
-VALUES (set(@person_id_4, next value for person_id_seq), 'george.doe', 'George Doe');
+VALUES (@person_id_4, 'george.doe', 'George Doe');
+UPDATE RAVE_SHINDIG_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @person_seq;
 
+set @person_id_5 = (SELECT seq_count FROM RAVE_SHINDIG_SEQUENCES WHERE seq_name = @person_seq);
 INSERT INTO person(id, username, display_name)
-VALUES (set(@person_id_5, next value for person_id_seq), 'mario.rossi', 'Mario Rossi');
+VALUES (@person_id_5, 'mario.rossi', 'Mario Rossi');
+UPDATE RAVE_SHINDIG_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @person_seq;
 
+set @next_person_association = (SELECT seq_count FROM RAVE_SHINDIG_SEQUENCES WHERE seq_name = @person_association_seq);
 INSERT INTO person_association(id, follower_id, followed_id)
-VALUES (next value for person_association_id_seq, @person_id_1, @person_id_2);
+VALUES (@next_person_association, @person_id_1, @person_id_2);
+UPDATE RAVE_SHINDIG_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @person_association_seq;
 
+set @next_person_association = (SELECT seq_count FROM RAVE_SHINDIG_SEQUENCES WHERE seq_name = @person_association_seq);
 INSERT INTO person_association(id, follower_id, followed_id)
-VALUES (next value for person_association_id_seq, @person_id_1, @person_id_3);
+VALUES (@next_person_association, @person_id_1, @person_id_3);
+UPDATE RAVE_SHINDIG_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @person_association_seq;
 
+set @next_person_association = (SELECT seq_count FROM RAVE_SHINDIG_SEQUENCES WHERE seq_name = @person_association_seq);
 INSERT INTO person_association(id, follower_id, followed_id)
-VALUES (next value for person_association_id_seq, @person_id_2, @person_id_4);
+VALUES (@next_person_association, @person_id_2, @person_id_4);
+UPDATE RAVE_SHINDIG_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @person_association_seq;
 
+set @group_id_1 = (SELECT seq_count FROM RAVE_SHINDIG_SEQUENCES WHERE seq_name = @groups_seq);
 INSERT INTO groups(id, title, description)
-VALUES (set(@group_id_1, next value for group_id_seq), 'Party', 'Party Group');
+VALUES (@group_id_1, 'Party', 'Party Group');
+UPDATE RAVE_SHINDIG_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @groups_seq;
 
+set @group_id_2 = (SELECT seq_count FROM RAVE_SHINDIG_SEQUENCES WHERE seq_name = @groups_seq);
 INSERT INTO groups(id, title, description)
-VALUES (set(@group_id_2, next value for group_id_seq), 'Portal', 'Portal Group');
+VALUES (@group_id_2, 'Portal', 'Portal Group');
+UPDATE RAVE_SHINDIG_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @groups_seq;
 
 INSERT INTO group_members(group_id, person_id)
 VALUES (@group_id_1, @person_id_1);

Modified: incubator/rave/trunk/rave-shindig/src/test/resources/test_data.sql
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-shindig/src/test/resources/test_data.sql?rev=1169628&r1=1169627&r2=1169628&view=diff
==============================================================================
--- incubator/rave/trunk/rave-shindig/src/test/resources/test_data.sql (original)
+++ incubator/rave/trunk/rave-shindig/src/test/resources/test_data.sql Mon Sep 12 07:24:40 2011
@@ -14,9 +14,15 @@
  -- KIND, either express or implied.  See the License for the
  -- specific language governing permissions and limitations
  -- under the License.
+set @token_info_seq = 'token_info';
+set @oauth_consumer_store_seq = 'oauth_consumer_store';
 
+set @token_info_id_1 = (SELECT seq_count FROM RAVE_SHINDIG_SEQUENCES WHERE seq_name = @token_info_seq);
 INSERT INTO oauth_token_info(id, access_token, token_secret, session_handle, token_expire_millis, app_url, module_id, token_name, service_name, user_id)
-VALUES (set(@token_info_id_1, next value for token_info_id_seq), 'accessToken', 'tokenSecret', 'sessionHandle', 3600000, 'http://localhost:8080/samplecontainer/examples/oauth.xml', 'NOT_USED', 'tokenName', 'serviceName', 'john.doe');
+VALUES (@token_info_id_1, 'accessToken', 'tokenSecret', 'sessionHandle', 3600000, 'http://localhost:8080/samplecontainer/examples/oauth.xml', 'NOT_USED', 'tokenName', 'serviceName', 'john.doe');
+UPDATE RAVE_SHINDIG_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @token_info_seq;
 
+set @consumer_store_id_1 = (SELECT seq_count FROM RAVE_SHINDIG_SEQUENCES WHERE seq_name = @oauth_consumer_store_seq);
 INSERT INTO oauth_consumer_store(id, gadget_uri, service_name, consumer_key, consumer_secret, key_type, key_name, callback_url)
-VALUES (set(@consumer_store_id_1, next value for consumer_store_id_seq), 'http://localhost:8080/samplecontainer/examples/oauth.xml', 'Google', 'gadgetConsumer', 'gadgetSecret', 'HMAC_SYMMETRIC', 'keyName', 'http://oauth.gmodules.com/gadgets/oauthcallback');
\ No newline at end of file
+VALUES (@consumer_store_id_1, 'http://localhost:8080/samplecontainer/examples/oauth.xml', 'Google', 'gadgetConsumer', 'gadgetSecret', 'HMAC_SYMMETRIC', 'keyName', 'http://oauth.gmodules.com/gadgets/oauthcallback');
+UPDATE RAVE_SHINDIG_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @oauth_consumer_store_seq;



Mime
View raw message