Author: ieb
Date: Mon Sep 15 09:52:45 2008
New Revision: 695547
URL: http://svn.apache.org/viewvc?rev=695547&view=rev
Log:
SHINDIG-594
Further javaadoc and explanation of the underlying persistence.
Modified:
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/AccountDb.java
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/ActivityDb.java
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/AddressDb.java
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/BodyTypeDb.java
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/EnumDb.java
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/ImDb.java
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/ListFieldDb.java
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/MediaItemDb.java
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/MessageDb.java
Modified:
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/AccountDb.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/AccountDb.java?rev=695547&r1=695546&r2=695547&view=diff
==============================================================================
---
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/AccountDb.java
(original)
+++
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/AccountDb.java
Mon Sep 15 09:52:45 2008
@@ -18,7 +18,6 @@
package org.apache.shindig.social.opensocial.jpa;
import org.apache.shindig.social.opensocial.model.Account;
-import org.apache.shindig.social.opensocial.model.Person;
import javax.persistence.Basic;
import javax.persistence.Column;
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=695547&r1=695546&r2=695547&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
Mon Sep 15 09:52:45 2008
@@ -19,7 +19,6 @@
import static javax.persistence.GenerationType.IDENTITY;
-import org.apache.shindig.social.opensocial.model.Account;
import org.apache.shindig.social.opensocial.model.Activity;
import org.apache.shindig.social.opensocial.model.MediaItem;
@@ -72,33 +71,60 @@
@Column(name = "version")
protected long version;
+ /**
+ * model field.
+ * @see Activity
+ */
@Basic
@Column(name = "app_id", length = 255)
protected String appId;
+ /**
+ * model field.
+ * @see Activity
+ */
@Basic
@Column(name = "body", length = 255)
protected String body;
+ /**
+ * model field.
+ * @see Activity
+ */
@Basic
@Column(name = "body_id", length = 255)
protected String bodyId;
+ /**
+ * model field.
+ * @see Activity
+ */
@Basic
@Column(name = "external_id", length = 255)
protected String externalId;
+ /**
+ * model field.
+ * @see Activity
+ */
@Basic
@Column(name = "activity_id", length = 255)
protected String id;
+ /**
+ * model field.
+ * @see Activity
+ */
@Basic
@Column(name = "updated")
@Temporal(TemporalType.TIMESTAMP)
protected Date updated;
- /*
- * Do a many to many join using table activity_media
+ /**
+ * 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)
@JoinTable(name = "activity_media",
@@ -213,46 +239,90 @@
this.userId = userId;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Activity#getAppId()
+ */
public String getAppId() {
return appId;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setAppId(java.lang.String)
+ */
public void setAppId(String appId) {
this.appId = appId;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Activity#getBody()
+ */
public String getBody() {
return body;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setBody(java.lang.String)
+ */
public void setBody(String body) {
this.body = body;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Activity#getBodyId()
+ */
public String getBodyId() {
return bodyId;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setBodyId(java.lang.String)
+ */
public void setBodyId(String bodyId) {
this.bodyId = bodyId;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Activity#getExternalId()
+ */
public String getExternalId() {
return externalId;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setExternalId(java.lang.String)
+ */
public void setExternalId(String externalId) {
this.externalId = externalId;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Activity#getId()
+ */
public String getId() {
return id;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setId(java.lang.String)
+ */
public void setId(String id) {
this.id = id;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Activity#getUpdated()
+ */
public Date getUpdated() {
if (updated == null) {
return null;
@@ -260,6 +330,10 @@
return new Date(updated.getTime());
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setUpdated(java.util.Date)
+ */
public void setUpdated(Date updated) {
if (updated == null) {
this.updated = null;
@@ -268,109 +342,210 @@
}
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Activity#getMediaItems()
+ */
public List<MediaItem> getMediaItems() {
return mediaItems;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setMediaItems(java.util.List)
+ */
public void setMediaItems(List<MediaItem> mediaItems) {
this.mediaItems = mediaItems;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Activity#getPostedTime()
+ */
public Long getPostedTime() {
return postedTime;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setPostedTime(java.lang.Long)
+ */
public void setPostedTime(Long postedTime) {
this.postedTime = postedTime;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Activity#getPriority()
+ */
public Float getPriority() {
return priority;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setPriority(java.lang.Float)
+ */
public void setPriority(Float priority) {
this.priority = priority;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#getStreamFaviconUrl()
+ */
public String getStreamFaviconUrl() {
return streamFaviconUrl;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setStreamFaviconUrl(java.lang.String)
+ */
public void setStreamFaviconUrl(String streamFaviconUrl) {
this.streamFaviconUrl = streamFaviconUrl;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#getStreamSourceUrl()
+ */
public String getStreamSourceUrl() {
return streamSourceUrl;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setStreamSourceUrl(java.lang.String)
+ */
public void setStreamSourceUrl(String streamSourceUrl) {
this.streamSourceUrl = streamSourceUrl;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Activity#getStreamTitle()
+ */
public String getStreamTitle() {
return streamTitle;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setStreamTitle(java.lang.String)
+ */
public void setStreamTitle(String streamTitle) {
this.streamTitle = streamTitle;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Activity#getStreamUrl()
+ */
public String getStreamUrl() {
return streamUrl;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setStreamUrl(java.lang.String)
+ */
public void setStreamUrl(String streamUrl) {
this.streamUrl = streamUrl;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#getTemplateParams()
+ */
public Map<String, String> getTemplateParams() {
return templateParams;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setTemplateParams(java.util.Map)
+ */
public void setTemplateParams(Map<String, String> templateParams) {
this.templateParams = templateParams;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Activity#getTitle()
+ */
public String getTitle() {
return title;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setTitle(java.lang.String)
+ */
public void setTitle(String title) {
this.title = title;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Activity#getTitleId()
+ */
public String getTitleId() {
return titleId;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setTitleId(java.lang.String)
+ */
public void setTitleId(String titleId) {
this.titleId = titleId;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Activity#getUrl()
+ */
public String getUrl() {
return url;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setUrl(java.lang.String)
+ */
public void setUrl(String url) {
this.url = url;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Activity#getUserId()
+ */
public String getUserId() {
return userId;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Activity#setUserId(java.lang.String)
+ */
public void setUserId(String userId) {
this.userId = userId;
}
- /**
- * @return the objectId
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.jpa.DbObject#getObjectId()
*/
public long getObjectId() {
return objectId;
}
+ /**
+ * 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() {
// add new entries
@@ -399,6 +574,10 @@
}
}
+ /**
+ * 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() {
templateParams = new ConcurrentHashMap<String, String>();
Modified:
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/AddressDb.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/AddressDb.java?rev=695547&r1=695546&r2=695547&view=diff
==============================================================================
---
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/AddressDb.java
(original)
+++
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/AddressDb.java
Mon Sep 15 09:52:45 2008
@@ -163,89 +163,176 @@
@Column(name = "primary_address")
private Boolean primary;
+ /**
+ * default constructor
+ */
public AddressDb() {
}
+ /**
+ * Create an address from the formatted address, no parsing of the address
will be performed.
+ * @param formatted the formatted address.
+ */
public AddressDb(String formatted) {
this.formatted = formatted;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Address#getCountry()
+ */
public String getCountry() {
return country;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Address#setCountry(java.lang.String)
+ */
public void setCountry(String country) {
this.country = country;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Address#getLatitude()
+ */
public Float getLatitude() {
return latitude;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Address#setLatitude(java.lang.Float)
+ */
public void setLatitude(Float latitude) {
this.latitude = latitude;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Address#getLocality()
+ */
public String getLocality() {
return locality;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Address#setLocality(java.lang.String)
+ */
public void setLocality(String locality) {
this.locality = locality;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Address#getLongitude()
+ */
public Float getLongitude() {
return longitude;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Address#setLongitude(java.lang.Float)
+ */
public void setLongitude(Float longitude) {
this.longitude = longitude;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Address#getPostalCode()
+ */
public String getPostalCode() {
return postalCode;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Address#setPostalCode(java.lang.String)
+ */
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Address#getRegion()
+ */
public String getRegion() {
return region;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Address#setRegion(java.lang.String)
+ */
public void setRegion(String region) {
this.region = region;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Address#getStreetAddress()
+ */
public String getStreetAddress() {
return streetAddress;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Address#setStreetAddress(java.lang.String)
+ */
public void setStreetAddress(String streetAddress) {
this.streetAddress = streetAddress;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Address#getType()
+ */
public String getType() {
return type;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Address#setType(java.lang.String)
+ */
public void setType(String type) {
this.type = type;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Address#getFormatted()
+ */
public String getFormatted() {
return formatted;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Address#setFormatted(java.lang.String)
+ */
public void setFormatted(String formatted) {
this.formatted = formatted;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Address#getPrimary()
+ */
public Boolean getPrimary() {
return primary;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Address#setPrimary(java.lang.Boolean)
+ */
public void setPrimary(Boolean primary) {
this.primary = primary;
}
Modified:
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/BodyTypeDb.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/BodyTypeDb.java?rev=695547&r1=695546&r2=695547&view=diff
==============================================================================
---
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/BodyTypeDb.java
(original)
+++
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/BodyTypeDb.java
Mon Sep 15 09:52:45 2008
@@ -21,7 +21,6 @@
import static javax.persistence.GenerationType.IDENTITY;
-import org.apache.shindig.social.opensocial.model.Address;
import org.apache.shindig.social.opensocial.model.BodyType;
import org.apache.shindig.social.opensocial.model.Person;
@@ -115,42 +114,82 @@
@Column(name = "weight", length = 255)
private String weight;
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.BodyType#getBuild()
+ */
public String getBuild() {
return build;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.BodyType#setBuild(java.lang.String)
+ */
public void setBuild(String build) {
this.build = build;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.BodyType#getEyeColor()
+ */
public String getEyeColor() {
return eyeColor;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.BodyType#setEyeColor(java.lang.String)
+ */
public void setEyeColor(String eyeColor) {
this.eyeColor = eyeColor;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.BodyType#getHairColor()
+ */
public String getHairColor() {
return hairColor;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.BodyType#setHairColor(java.lang.String)
+ */
public void setHairColor(String hairColor) {
this.hairColor = hairColor;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.BodyType#getHeight()
+ */
public String getHeight() {
return height;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.BodyType#setHeight(java.lang.String)
+ */
public void setHeight(String height) {
this.height = height;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.BodyType#getWeight()
+ */
public String getWeight() {
return weight;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.BodyType#setWeight(java.lang.String)
+ */
public void setWeight(String weight) {
this.weight = weight;
}
Modified:
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/EnumDb.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/EnumDb.java?rev=695547&r1=695546&r2=695547&view=diff
==============================================================================
---
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/EnumDb.java
(original)
+++
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/EnumDb.java
Mon Sep 15 09:52:45 2008
@@ -49,18 +49,34 @@
this(value, value.getDisplayValue());
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Enum#getDisplayValue()
+ */
public String getDisplayValue() {
return displayValue;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Enum#setDisplayValue(java.lang.String)
+ */
public void setDisplayValue(String displayValue) {
this.displayValue = displayValue;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Enum#getValue()
+ */
public E getValue() {
return value;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @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/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/ImDb.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/ImDb.java?rev=695547&r1=695546&r2=695547&view=diff
==============================================================================
---
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/ImDb.java
(original)
+++
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/ImDb.java
Mon Sep 15 09:52:45 2008
@@ -26,17 +26,20 @@
import javax.persistence.Table;
/**
- * IM (Instant Message account) Entity, extends the ListField object
- * (and list_field table), joining on the object ID.
- * Objects of this type will have "list_field_type" set to ImDb in list_field
+ * IM (Instant Message account) Entity, extends the ListField object (and
list_field table), joining
+ * on the object ID. Objects of this type will have "list_field_type" set to
ImDb in list_field
*/
@Entity
[EMAIL PROTECTED](name="im")
[EMAIL PROTECTED](name="oid")
[EMAIL PROTECTED](name = "im")
[EMAIL PROTECTED](name = "oid")
public class ImDb extends ListFieldDb {
- @ManyToOne(targetEntity=PersonDb.class)
- @JoinColumn(name="person_id", referencedColumnName="oid")
+ /**
+ * The person who owns this IM account. This information is maintained in
the database using a
+ * join column "person_id" in the im table that points to oid in the person
table.
+ */
+ @ManyToOne(targetEntity = PersonDb.class)
+ @JoinColumn(name = "person_id", referencedColumnName = "oid")
protected Person person;
}
Modified:
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/ListFieldDb.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/ListFieldDb.java?rev=695547&r1=695546&r2=695547&view=diff
==============================================================================
---
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/ListFieldDb.java
(original)
+++
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/ListFieldDb.java
Mon Sep 15 09:52:45 2008
@@ -34,6 +34,12 @@
import javax.persistence.Table;
import javax.persistence.Version;
+/**
+ * List fields represent storage of list of fields potentially with a
preferred or primary value.
+ * This is the base storage class for all list fields, stored in the
lsit_field table. Classes will
+ * extend this class using a join strategy and setting the list_field_type
column to the type of
+ * class represented by the record. If there is no type it defaults to
ListFieldDb.
+ */
@MappedSuperclass
@Table(name="list_field")
@Inheritance(strategy=InheritanceType.JOINED)
@@ -50,58 +56,103 @@
protected long objectId;
/**
- * An optimistic locking field
+ * An optimistic locking field.
*/
@Version
@Column(name="version")
protected long version;
+ /**
+ * model field.
+ * @see ListField
+ */
@Basic
@Column(name="field_type", length=255)
protected String type;
+ /**
+ * model field.
+ * @see ListField
+ */
@Basic
@Column(name="field_value", length=255)
protected String value;
+ /**
+ * model field.
+ * @see ListField
+ */
@Basic
@Column(name="primary_field")
protected Boolean primary;
+ /**
+ * Create a list field.
+ */
public ListFieldDb() { }
+ /**
+ * Create a list field, specifying the type and the value.
+ * @param type the type or name of the field
+ * @param value the value contained in the field.
+ */
public ListFieldDb(String type, String value) {
this.type = type;
this.value = value;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.ListField#getType()
+ */
public String getType() {
return type;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.ListField#setType(java.lang.String)
+ */
public void setType(String type) {
this.type = type;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.ListField#getValue()
+ */
public String getValue() {
return value;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.ListField#setValue(java.lang.String)
+ */
public void setValue(String value) {
this.value = value;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.ListField#getPrimary()
+ */
public Boolean getPrimary() {
return primary;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.ListField#setPrimary(java.lang.Boolean)
+ */
public void setPrimary(Boolean primary) {
this.primary = primary;
}
- /**
- * @return the objectId
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.jpa.DbObject#getObjectId()
*/
public long getObjectId() {
return objectId;
Modified:
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/MediaItemDb.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/MediaItemDb.java?rev=695547&r1=695546&r2=695547&view=diff
==============================================================================
---
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/MediaItemDb.java
(original)
+++
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/MediaItemDb.java
Mon Sep 15 09:52:45 2008
@@ -37,7 +37,8 @@
import java.util.List;
/**
- *
+ * Media items are stored in the media_item table, Items may be shared amongst
activities and are
+ * related to people.
*/
@Entity
@Table(name = "media_item")
@@ -58,72 +59,131 @@
@Column(name = "version")
protected long version;
- /*
- * The mapping for this is in ActivityDb.
+ /**
+ * 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 MediaItem
+ */
@Basic
@Column(name = "mime_type", length = 255)
private String mimeType;
+ /**
+ * model field.
+ * @see MediaItem
+ */
@Basic
@Column(name = "media_type")
private String typeDb;
+ /**
+ * model field.
+ * @see MediaItem
+ */
@Transient
private Type type;
+ /**
+ * model field.
+ * @see MediaItem
+ */
@Basic
@Column(name = "url", length = 255)
private String url;
+ /**
+ * 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;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.MediaItem#getMimeType()
+ */
public String getMimeType() {
return mimeType;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.MediaItem#setMimeType(java.lang.String)
+ */
public void setMimeType(String mimeType) {
this.mimeType = mimeType;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.MediaItem#getType()
+ */
public Type getType() {
return type;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @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;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.MediaItem#getUrl()
+ */
public String getUrl() {
return url;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.MediaItem#setUrl(java.lang.String)
+ */
public void setUrl(String url) {
this.url = url;
}
- /**
- * @return the objectId
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.jpa.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/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/MessageDb.java
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/MessageDb.java?rev=695547&r1=695546&r2=695547&view=diff
==============================================================================
---
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/MessageDb.java
(original)
+++
incubator/shindig/trunk/java/samples/src/main/java/org/apache/shindig/social/opensocial/jpa/MessageDb.java
Mon Sep 15 09:52:45 2008
@@ -32,6 +32,9 @@
import javax.persistence.Transient;
import javax.persistence.Version;
+/**
+ * Messages are stored in the message table.
+ */
@Entity
@Table(name="message")
public class MessageDb implements Message, DbObject {
@@ -51,70 +54,130 @@
@Column(name="version")
protected long version;
+ /**
+ * model field.
+ * @see Message
+ */
@Basic
@Column(name="body", length=255)
protected String body;
+ /**
+ * model field.
+ * @see Message
+ */
@Basic
@Column(name="title", length=255)
protected String title;
+ /**
+ * model field. (database representation of type)
+ * @see Message
+ */
@Basic
@Column(name="message_type")
protected String typeDb;
+ /**
+ * model field.
+ * @see Message
+ */
@Transient
protected Type type;
+ /**
+ * create an empty message.
+ */
public MessageDb() {
}
+ /**
+ * Create a message object with body, title and type.
+ * @param initBody the body of the message.
+ * @param initTitle the title of the message.
+ * @param initType the type of the message.
+ */
public MessageDb(String initBody, String initTitle, Type initType) {
this.body = initBody;
this.title = initTitle;
this.type = initType;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Message#getBody()
+ */
public String getBody() {
return this.body;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Message#setBody(java.lang.String)
+ */
public void setBody(String newBody) {
this.body = newBody;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Message#getTitle()
+ */
public String getTitle() {
return this.title;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Message#setTitle(java.lang.String)
+ */
public void setTitle(String newTitle) {
this.title = newTitle;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.model.Message#getType()
+ */
public Type getType() {
return type;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Message#setType(org.apache.shindig.social.opensocial.model.Message.Type)
+ */
public void setType(Type newType) {
this.type = newType;
}
+ /**
+ * [EMAIL PROTECTED]
+ * @see
org.apache.shindig.social.opensocial.model.Message#sanitizeHTML(java.lang.String)
+ */
public String sanitizeHTML(String htmlStr) {
return htmlStr;
}
/**
- * @return the objectId
+ * [EMAIL PROTECTED]
+ * @see org.apache.shindig.social.opensocial.jpa.DbObject#getObjectId()
*/
public long getObjectId() {
return objectId;
}
+ /**
+ *
+ */
@PrePersist
public void populateDbFields() {
typeDb = type.toString();
}
+ /**
+ *
+ */
@PostLoad
public void loadTransientFields() {
type = Type.valueOf(typeDb);