You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by sc...@apache.org on 2010/06/16 16:16:40 UTC
svn commit: r955236 [7/10] - in
/incubator/wookie/branches/pluggablepersistence: ./ WebContent/WEB-INF/
WebContent/admin/ WebContent/webmenu/ ant/ etc/ddl-schema/ etc/tomcat/
etc/tomcat/conf/ parser/java/src/org/apache/wookie/w3c/util/ scripts/
scripts...
Added: incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/FeatureImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/FeatureImpl.java?rev=955236&view=auto
==============================================================================
--- incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/FeatureImpl.java (added)
+++ incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/FeatureImpl.java Wed Jun 16 14:16:36 2010
@@ -0,0 +1,149 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wookie.beans.jpa.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+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.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+import org.apache.openjpa.persistence.ElementDependent;
+import org.apache.openjpa.persistence.ExternalValues;
+import org.apache.openjpa.persistence.Type;
+
+import org.apache.wookie.beans.IFeature;
+import org.apache.wookie.beans.IParam;
+import org.apache.wookie.beans.jpa.IInverseRelationship;
+import org.apache.wookie.beans.jpa.InverseRelationshipCollection;
+
+/**
+ * FeatureImpl - JPA IFeature implementation.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+@Entity(name="Feature")
+@Table(name="Feature")
+public class FeatureImpl implements IFeature, IInverseRelationship<WidgetImpl>
+{
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ @Column(name="id", nullable=false)
+ @SuppressWarnings("unused")
+ private int id;
+
+ @Version
+ @Column(name="jpa_version")
+ @SuppressWarnings("unused")
+ private int jpaVersion;
+
+ @Basic(optional=false)
+ @Column(name="featureName", nullable=false)
+ private String featureName;
+
+ @Basic
+ @Column(name="required")
+ @ExternalValues({"true=t","false=f","null="})
+ @Type(String.class)
+ private Boolean required;
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="widget_id", referencedColumnName="id")
+ @SuppressWarnings("unused")
+ private WidgetImpl widget;
+
+ @OneToMany(mappedBy="parentFeature", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
+ @ElementDependent
+ private Collection<ParamImpl> parameters;
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.util.IInverseRelationship#updateInverseRelationship(java.lang.Object)
+ */
+ public void updateInverseRelationship(WidgetImpl owningObject)
+ {
+ widget = owningObject;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IFeature#getFeatureName()
+ */
+ public String getFeatureName()
+ {
+ return featureName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IFeature#setFeatureName(java.lang.String)
+ */
+ public void setFeatureName(String featureName)
+ {
+ this.featureName = featureName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IFeature#getParameters()
+ */
+ public Collection<IParam> getParameters()
+ {
+ if (parameters == null)
+ {
+ parameters = new ArrayList<ParamImpl>();
+ }
+ return new InverseRelationshipCollection<FeatureImpl,ParamImpl,IParam>(this, parameters);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IFeature#setParameters(java.util.Collection)
+ */
+ public void setParameters(Collection<IParam> parameters)
+ {
+ getParameters().clear();
+ if (parameters != null)
+ {
+ for (IParam parameter : parameters)
+ {
+ getParameters().add((ParamImpl)parameter);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IFeature#isRequired()
+ */
+ public boolean isRequired()
+ {
+ return ((required != null) ? required.booleanValue() : false);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IFeature#setRequired(boolean)
+ */
+ public void setRequired(boolean required)
+ {
+ this.required = (required ? Boolean.TRUE : Boolean.FALSE);
+ }
+}
Added: incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/LicenseImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/LicenseImpl.java?rev=955236&view=auto
==============================================================================
--- incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/LicenseImpl.java (added)
+++ incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/LicenseImpl.java Wed Jun 16 14:16:36 2010
@@ -0,0 +1,105 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wookie.beans.jpa.impl;
+
+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.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+import org.apache.wookie.beans.ILicense;
+import org.apache.wookie.beans.jpa.IInverseRelationship;
+
+/**
+ * LicenseImpl - JPA ILicense implementation.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+@Entity(name="License")
+@Table(name="License")
+public class LicenseImpl extends LocalizedBeanImpl implements ILicense, IInverseRelationship<WidgetImpl>
+{
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ @Column(name="id", nullable=false)
+ @SuppressWarnings("unused")
+ private int id;
+
+ @Version
+ @Column(name="jpa_version")
+ @SuppressWarnings("unused")
+ private int jpaVersion;
+
+ @Basic
+ @Column(name="href")
+ private String href;
+
+ @Basic
+ @Column(name="text")
+ private String text;
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="widget_id", referencedColumnName="id")
+ @SuppressWarnings("unused")
+ private WidgetImpl widget;
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.util.IInverseRelationship#updateInverseRelationship(java.lang.Object)
+ */
+ public void updateInverseRelationship(WidgetImpl owningObject)
+ {
+ widget = owningObject;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.ILicense#getHref()
+ */
+ public String getHref()
+ {
+ return href;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.ILicense#setHref(java.lang.String)
+ */
+ public void setHref(String href)
+ {
+ this.href = href;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.ILicense#getText()
+ */
+ public String getText()
+ {
+ return text;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.ILicense#setText(java.lang.String)
+ */
+ public void setText(String text)
+ {
+ this.text = text;
+ }
+}
Added: incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/LocalizedBeanImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/LocalizedBeanImpl.java?rev=955236&view=auto
==============================================================================
--- incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/LocalizedBeanImpl.java (added)
+++ incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/LocalizedBeanImpl.java Wed Jun 16 14:16:36 2010
@@ -0,0 +1,71 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wookie.beans.jpa.impl;
+
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.MappedSuperclass;
+
+import org.apache.wookie.beans.ILocalizedBean;
+
+/**
+ * LocalizedBeanImpl - JPA ILocalizedBeanImpl implementation.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+@MappedSuperclass
+public abstract class LocalizedBeanImpl implements ILocalizedBean
+{
+ @Basic
+ @Column(name="dir")
+ private String dir;
+
+ @Basic
+ @Column(name="lang")
+ private String lang;
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.ILocalizedBean#getDir()
+ */
+ public String getDir()
+ {
+ return dir;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.ILocalizedBean#setDir(java.lang.String)
+ */
+ public void setDir(String dir)
+ {
+ this.dir = dir;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.ILocalizedBean#getLang()
+ */
+ public String getLang()
+ {
+ return lang;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.ILocalizedBean#setLang(java.lang.String)
+ */
+ public void setLang(String lang)
+ {
+ this.lang = lang;
+ }
+}
Added: incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/NameImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/NameImpl.java?rev=955236&view=auto
==============================================================================
--- incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/NameImpl.java (added)
+++ incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/NameImpl.java Wed Jun 16 14:16:36 2010
@@ -0,0 +1,105 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wookie.beans.jpa.impl;
+
+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.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+import org.apache.wookie.beans.IName;
+import org.apache.wookie.beans.jpa.IInverseRelationship;
+
+/**
+ * NameImpl - JPA IName implementation.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+@Entity(name="Name")
+@Table(name="Name")
+public class NameImpl extends LocalizedBeanImpl implements IName, IInverseRelationship<WidgetImpl>
+{
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ @Column(name="id", nullable=false)
+ @SuppressWarnings("unused")
+ private int id;
+
+ @Version
+ @Column(name="jpa_version")
+ @SuppressWarnings("unused")
+ private int jpaVersion;
+
+ @Basic
+ @Column(name="name")
+ private String name;
+
+ @Basic
+ @Column(name="shortName")
+ private String shortName;
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="widget_id", referencedColumnName="id")
+ @SuppressWarnings("unused")
+ private WidgetImpl widget;
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.util.IInverseRelationship#updateInverseRelationship(java.lang.Object)
+ */
+ public void updateInverseRelationship(WidgetImpl owningObject)
+ {
+ widget = owningObject;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IName#getName()
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IName#setName(java.lang.String)
+ */
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IName#getShortName()
+ */
+ public String getShortName()
+ {
+ return shortName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IName#setShortName(java.lang.String)
+ */
+ public void setShortName(String shortName)
+ {
+ this.shortName = shortName;
+ }
+}
Added: incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/ParamImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/ParamImpl.java?rev=955236&view=auto
==============================================================================
--- incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/ParamImpl.java (added)
+++ incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/ParamImpl.java Wed Jun 16 14:16:36 2010
@@ -0,0 +1,105 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wookie.beans.jpa.impl;
+
+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.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+import org.apache.wookie.beans.IParam;
+import org.apache.wookie.beans.jpa.IInverseRelationship;
+
+/**
+ * ParamImpl - JPA IParam implementation.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+@Entity(name="Param")
+@Table(name="Param")
+public class ParamImpl implements IParam, IInverseRelationship<FeatureImpl>
+{
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ @Column(name="id", nullable=false)
+ @SuppressWarnings("unused")
+ private int id;
+
+ @Version
+ @Column(name="jpa_version")
+ @SuppressWarnings("unused")
+ private int jpaVersion;
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="feature_id", referencedColumnName="id")
+ @SuppressWarnings("unused")
+ private FeatureImpl parentFeature;
+
+ @Basic(optional=false)
+ @Column(name="parameterName", nullable=false)
+ private String parameterName;
+
+ @Basic(optional=false)
+ @Column(name="parameterValue", nullable=false)
+ private String parameterValue;
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.util.IInverseRelationship#updateInverseRelationship(java.lang.Object)
+ */
+ public void updateInverseRelationship(FeatureImpl owningObject)
+ {
+ parentFeature = owningObject;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IParam#getParameterName()
+ */
+ public String getParameterName()
+ {
+ return parameterName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IParam#setParameterName(java.lang.String)
+ */
+ public void setParameterName(String parameterName)
+ {
+ this.parameterName = parameterName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IParam#getParameterValue()
+ */
+ public String getParameterValue()
+ {
+ return parameterValue;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IParam#setParameterValue(java.lang.String)
+ */
+ public void setParameterValue(String parameterValue)
+ {
+ this.parameterValue = parameterValue;
+ }
+}
Added: incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/ParticipantImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/ParticipantImpl.java?rev=955236&view=auto
==============================================================================
--- incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/ParticipantImpl.java (added)
+++ incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/ParticipantImpl.java Wed Jun 16 14:16:36 2010
@@ -0,0 +1,163 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wookie.beans.jpa.impl;
+
+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.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+import org.apache.wookie.beans.IParticipant;
+import org.apache.wookie.beans.IWidget;
+
+/**
+ * ParticipantImpl - JPA IParticipant implementation.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+@Entity(name="Participant")
+@Table(name="Participant")
+@NamedQueries({@NamedQuery(name="PARTICIPANTS", query="SELECT p FROM Participant p WHERE p.sharedDataKey = :sharedDataKey AND p.widget = :widget"),
+ @NamedQuery(name="PARTICIPANT_VIEWER", query="SELECT p FROM Participant p WHERE p.sharedDataKey = :sharedDataKey AND p.widget = :widget AND p.participantId = :userId")})
+public class ParticipantImpl implements IParticipant
+{
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ @Column(name="id", nullable=false)
+ private int id;
+
+ @Version
+ @Column(name="jpa_version")
+ @SuppressWarnings("unused")
+ private int jpaVersion;
+
+ @Basic(optional=false)
+ @Column(name="participant_id", nullable=false)
+ private String participantId;
+
+ @Basic(optional=false)
+ @Column(name="participant_display_name", nullable=false)
+ private String participantDisplayName;
+
+ @Basic(optional=false)
+ @Column(name="participant_thumbnail_url", nullable=false)
+ private String participantThumbnailUrl;
+
+ @Basic(optional=false)
+ @Column(name="sharedDataKey", nullable=false)
+ private String sharedDataKey;
+
+ @ManyToOne(fetch=FetchType.LAZY, optional=false)
+ @JoinColumn(name="widget_id", referencedColumnName="id", nullable=false)
+ private WidgetImpl widget;
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IBean#getId()
+ */
+ public Object getId()
+ {
+ return id;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.util.IParticipant#getParticipantDisplayName()
+ */
+ public String getParticipantDisplayName()
+ {
+ return participantDisplayName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IParticipant#setParticipantDisplayName(java.lang.String)
+ */
+ public void setParticipantDisplayName(String participantDisplayName)
+ {
+ this.participantDisplayName = participantDisplayName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IParticipant#getParticipantId()
+ */
+ public String getParticipantId()
+ {
+ return participantId;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IParticipant#setParticipantId(java.lang.String)
+ */
+ public void setParticipantId(String participantId)
+ {
+ this.participantId = participantId;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IParticipant#getParticipantThumbnailUrl()
+ */
+ public String getParticipantThumbnailUrl()
+ {
+ return participantThumbnailUrl;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IParticipant#setParticipantThumbnailUrl(java.lang.String)
+ */
+ public void setParticipantThumbnailUrl(String participantThumbnailUrl)
+ {
+ this.participantThumbnailUrl = participantThumbnailUrl;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IParticipant#getSharedDataKey()
+ */
+ public String getSharedDataKey()
+ {
+ return sharedDataKey;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IParticipant#setSharedDataKey(java.lang.String)
+ */
+ public void setSharedDataKey(String sharedDataKey)
+ {
+ this.sharedDataKey = sharedDataKey;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IParticipant#getWidget()
+ */
+ public IWidget getWidget()
+ {
+ return widget;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IParticipant#setWidget(org.apache.wookie.beans.IWidget)
+ */
+ public void setWidget(IWidget widget)
+ {
+ this.widget = (WidgetImpl)widget;
+ }
+}
Added: incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/PostImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/PostImpl.java?rev=955236&view=auto
==============================================================================
--- incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/PostImpl.java (added)
+++ incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/PostImpl.java Wed Jun 16 14:16:36 2010
@@ -0,0 +1,235 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wookie.beans.jpa.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+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.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Version;
+
+import org.apache.openjpa.persistence.ElementDependent;
+import org.apache.wookie.beans.IPost;
+import org.apache.wookie.beans.jpa.IInverseRelationship;
+import org.apache.wookie.beans.jpa.InverseRelationshipCollection;
+
+/**
+ * PostImpl - JPA IPost implementation.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+@Entity(name="Post")
+@Table(name="Post")
+public class PostImpl implements IPost, IInverseRelationship<PostImpl>
+{
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ @Column(name="id", nullable=false)
+ private int id;
+
+ @Version
+ @Column(name="jpa_version")
+ @SuppressWarnings("unused")
+ private int jpaVersion;
+
+ @Basic(optional=false)
+ @Column(name="user_id", nullable=false)
+ private String userId;
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="parent_id", referencedColumnName="id")
+ @SuppressWarnings("unused")
+ private PostImpl parent;
+
+ @OneToMany(mappedBy="parent", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
+ @ElementDependent
+ private Collection<PostImpl> posts;
+
+ @Basic(optional=false)
+ @Column(name="title", nullable=false)
+ private String title;
+
+ @Basic
+ @Column(name="content")
+ private String content;
+
+ @Basic(optional=false)
+ @Column(name="publish_date", nullable=false)
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date publishDate;
+
+ @Basic
+ @Column(name="update_date")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date updateDate;
+
+ @Basic(optional=false)
+ @Column(name="sharedDataKey", nullable=false)
+ private String sharedDataKey;
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.util.IInverseRelationship#updateInverseRelationship(java.lang.Object)
+ */
+ public void updateInverseRelationship(PostImpl owningObject)
+ {
+ parent = owningObject;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPost#getContent()
+ */
+ public String getContent()
+ {
+ return content;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPost#setContent(java.lang.String)
+ */
+ public void setContent(String content)
+ {
+ this.content = content;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IBean#getId()
+ */
+ public Object getId()
+ {
+ return id;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPost#getPosts()
+ */
+ public Collection<IPost> getPosts()
+ {
+ if (posts == null)
+ {
+ posts = new ArrayList<PostImpl>();
+ }
+ return new InverseRelationshipCollection<PostImpl,PostImpl,IPost>(this, posts);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPost#setPosts(java.util.Collection)
+ */
+ public void setPosts(Collection<IPost> posts)
+ {
+ getPosts().clear();
+ if (posts != null)
+ {
+ for (IPost widgetType : posts)
+ {
+ getPosts().add((PostImpl)widgetType);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPost#getPublishDate()
+ */
+ public Date getPublishDate()
+ {
+ return publishDate;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPost#setPublishDate(java.util.Date)
+ */
+ public void setPublishDate(Date publishDate)
+ {
+ this.publishDate = publishDate;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPost#getSharedDataKey()
+ */
+ public String getSharedDataKey()
+ {
+ return sharedDataKey;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPost#setSharedDataKey(java.lang.String)
+ */
+ public void setSharedDataKey(String sharedDataKey)
+ {
+ this.sharedDataKey = sharedDataKey;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPost#getTitle()
+ */
+ public String getTitle()
+ {
+ return title;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPost#setTitle(java.lang.String)
+ */
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPost#getUpdateDate()
+ */
+ public Date getUpdateDate()
+ {
+ return updateDate;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPost#setUpdateDate(java.util.Date)
+ */
+ public void setUpdateDate(Date updateDate)
+ {
+ this.updateDate = updateDate;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPost#getUserId()
+ */
+ public String getUserId()
+ {
+ return userId;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPost#setUserId(java.lang.String)
+ */
+ public void setUserId(String userId)
+ {
+ this.userId = userId;
+ }
+}
Added: incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/PreferenceDefaultImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/PreferenceDefaultImpl.java?rev=955236&view=auto
==============================================================================
--- incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/PreferenceDefaultImpl.java (added)
+++ incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/PreferenceDefaultImpl.java Wed Jun 16 14:16:36 2010
@@ -0,0 +1,130 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wookie.beans.jpa.impl;
+
+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.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+import org.apache.openjpa.persistence.ExternalValues;
+import org.apache.openjpa.persistence.Type;
+
+import org.apache.wookie.beans.IPreferenceDefault;
+import org.apache.wookie.beans.jpa.IInverseRelationship;
+
+/**
+ * PreferenceDefaultImpl - JPA IPreferenceDefault implementation.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+@Entity(name="PreferenceDefault")
+@Table(name="PreferenceDefault")
+public class PreferenceDefaultImpl implements IPreferenceDefault, IInverseRelationship<WidgetImpl>
+{
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ @Column(name="id", nullable=false)
+ @SuppressWarnings("unused")
+ private int id;
+
+ @Version
+ @Column(name="jpa_version")
+ @SuppressWarnings("unused")
+ private int jpaVersion;
+
+ @Basic(optional=false)
+ @Column(name="preference", nullable=false)
+ private String preference;
+
+ @Basic(optional=false)
+ @Column(name="value", nullable=false)
+ private String value;
+
+ @Basic
+ @Column(name="readOnly")
+ @ExternalValues({"true=t","false=f","null="})
+ @Type(String.class)
+ private Boolean readOnly;
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="widget_id", referencedColumnName="id")
+ @SuppressWarnings("unused")
+ private WidgetImpl widget;
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.util.IInverseRelationship#updateInverseRelationship(java.lang.Object)
+ */
+ public void updateInverseRelationship(WidgetImpl owningObject)
+ {
+ widget = owningObject;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPreferenceDefault#getPreference()
+ */
+ public String getPreference()
+ {
+ return preference;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPreferenceDefault#setPreference(java.lang.String)
+ */
+ public void setPreference(String preference)
+ {
+ this.preference = preference;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPreferenceDefault#getValue()
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPreferenceDefault#setValue(java.lang.String)
+ */
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPreferenceDefault#isReadOnly()
+ */
+ public boolean isReadOnly()
+ {
+ return ((readOnly != null) ? readOnly.booleanValue() : false);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPreferenceDefault#setReadOnly(boolean)
+ */
+ public void setReadOnly(boolean readOnly)
+ {
+ this.readOnly = (readOnly ? Boolean.TRUE : Boolean.FALSE);
+ }
+}
Added: incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/PreferenceImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/PreferenceImpl.java?rev=955236&view=auto
==============================================================================
--- incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/PreferenceImpl.java (added)
+++ incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/PreferenceImpl.java Wed Jun 16 14:16:36 2010
@@ -0,0 +1,130 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wookie.beans.jpa.impl;
+
+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.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+import org.apache.openjpa.persistence.ExternalValues;
+import org.apache.openjpa.persistence.Type;
+
+import org.apache.wookie.beans.IPreference;
+import org.apache.wookie.beans.jpa.IInverseRelationship;
+
+/**
+ * PreferenceImpl - JPA IPreference implementation.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+@Entity(name="Preference")
+@Table(name="Preference")
+public class PreferenceImpl implements IPreference, IInverseRelationship<WidgetInstanceImpl>
+{
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ @Column(name="id", nullable=false)
+ @SuppressWarnings("unused")
+ private int id;
+
+ @Version
+ @Column(name="jpa_version")
+ @SuppressWarnings("unused")
+ private int jpaVersion;
+
+ @Basic
+ @Column(name="dkey")
+ private String dkey;
+
+ @Basic
+ @Column(name="dvalue")
+ private String dvalue;
+
+ @Basic
+ @Column(name="readOnly")
+ @ExternalValues({"true=t","false=f","null="})
+ @Type(String.class)
+ private Boolean readOnly;
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="widget_instance_id", referencedColumnName="id")
+ @SuppressWarnings("unused")
+ private WidgetInstanceImpl widgetInstance;
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.util.IInverseRelationship#updateInverseRelationship(java.lang.Object)
+ */
+ public void updateInverseRelationship(WidgetInstanceImpl owningObject)
+ {
+ widgetInstance = owningObject;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPreference#getDkey()
+ */
+ public String getDkey()
+ {
+ return dkey;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPreference#setDkey(java.lang.String)
+ */
+ public void setDkey(String dkey)
+ {
+ this.dkey = dkey;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPreference#getDvalue()
+ */
+ public String getDvalue()
+ {
+ return dvalue;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPreference#setDvalue(java.lang.String)
+ */
+ public void setDvalue(String dvalue)
+ {
+ this.dvalue = dvalue;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPreference#isReadOnly()
+ */
+ public boolean isReadOnly()
+ {
+ return ((readOnly != null) ? readOnly.booleanValue() : false);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IPreference#setReadOnly(boolean)
+ */
+ public void setReadOnly(boolean readOnly)
+ {
+ this.readOnly = (readOnly ? Boolean.TRUE : Boolean.FALSE);
+ }
+}
Added: incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/ServerFeatureImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/ServerFeatureImpl.java?rev=955236&view=auto
==============================================================================
--- incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/ServerFeatureImpl.java (added)
+++ incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/ServerFeatureImpl.java Wed Jun 16 14:16:36 2010
@@ -0,0 +1,99 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wookie.beans.jpa.impl;
+
+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.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+import org.apache.wookie.beans.IServerFeature;
+
+/**
+ * ServerFeatureImpl - JPA IServerFeature implementation.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+@Entity(name="ServerFeature")
+@Table(name="ServerFeature")
+@NamedQueries({@NamedQuery(name="SERVER_FEATURE", query="SELECT sf FROM ServerFeature sf WHERE sf.featureName = :featureName"),
+ @NamedQuery(name="SERVER_FEATURE_NAMES", query="SELECT sf.featureName FROM ServerFeature sf")})
+public class ServerFeatureImpl implements IServerFeature
+{
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ @Column(name="id", nullable=false)
+ private int id;
+
+ @Version
+ @Column(name="jpa_version")
+ @SuppressWarnings("unused")
+ private int jpaVersion;
+
+ @Basic(optional=false)
+ @Column(name="featureName", nullable=false)
+ private String featureName;
+
+ @Basic(optional=false)
+ @Column(name="className", nullable=false)
+ private String className;
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IServerFeature#getClassName()
+ */
+ public String getClassName()
+ {
+ return className;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IServerFeature#setClassName(java.lang.String)
+ */
+ public void setClassName(String className)
+ {
+ this.className = className;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IServerFeature#getFeatureName()
+ */
+ public String getFeatureName()
+ {
+ return featureName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IServerFeature#setFeatureName(java.lang.String)
+ */
+ public void setFeatureName(String featureName)
+ {
+ this.featureName = featureName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IBean#getId()
+ */
+ public Object getId()
+ {
+ return id;
+ }
+}
Added: incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/SharedDataImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/SharedDataImpl.java?rev=955236&view=auto
==============================================================================
--- incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/SharedDataImpl.java (added)
+++ incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/SharedDataImpl.java Wed Jun 16 14:16:36 2010
@@ -0,0 +1,125 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wookie.beans.jpa.impl;
+
+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.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+import org.apache.wookie.beans.ISharedData;
+import org.apache.wookie.beans.jpa.IInverseRelationship;
+
+/**
+ * DescriptionImpl - JPA IDescription implementation.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+@Entity(name="SharedData")
+@Table(name="SharedData")
+public class SharedDataImpl implements ISharedData, IInverseRelationship<WidgetImpl>
+{
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ @Column(name="id", nullable=false)
+ @SuppressWarnings("unused")
+ private int id;
+
+ @Version
+ @Column(name="jpa_version")
+ @SuppressWarnings("unused")
+ private int jpaVersion;
+
+ @Basic
+ @Column(name="sharedDataKey")
+ private String sharedDataKey;
+
+ @Basic
+ @Column(name="dkey")
+ private String dkey;
+
+ @Basic
+ @Column(name="dvalue")
+ private String dvalue;
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="widget_id", referencedColumnName="id")
+ @SuppressWarnings("unused")
+ private WidgetImpl widget;
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.util.IInverseRelationship#updateInverseRelationship(java.lang.Object)
+ */
+ public void updateInverseRelationship(WidgetImpl owningObject)
+ {
+ widget = owningObject;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.ISharedData#getDkey()
+ */
+ public String getDkey()
+ {
+ return dkey;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.ISharedData#setDkey(java.lang.String)
+ */
+ public void setDkey(String dkey)
+ {
+ this.dkey = dkey;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.ISharedData#getDvalue()
+ */
+ public String getDvalue()
+ {
+ return dvalue;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.ISharedData#setDvalue(java.lang.String)
+ */
+ public void setDvalue(String dvalue)
+ {
+ this.dvalue = dvalue;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.ISharedData#getSharedDataKey()
+ */
+ public String getSharedDataKey()
+ {
+ return sharedDataKey;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.ISharedData#setSharedDataKey(java.lang.String)
+ */
+ public void setSharedDataKey(String sharedDataKey)
+ {
+ this.sharedDataKey = sharedDataKey;
+ }
+}
Added: incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/StartFileImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/StartFileImpl.java?rev=955236&view=auto
==============================================================================
--- incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/StartFileImpl.java (added)
+++ incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/StartFileImpl.java Wed Jun 16 14:16:36 2010
@@ -0,0 +1,125 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wookie.beans.jpa.impl;
+
+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.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+import org.apache.wookie.beans.IStartFile;
+import org.apache.wookie.beans.jpa.IInverseRelationship;
+
+/**
+ * StartFileImpl - JPA IStartFile implementation.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+@Entity(name="StartFile")
+@Table(name="StartFile")
+public class StartFileImpl implements IStartFile, IInverseRelationship<WidgetImpl>
+{
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ @Column(name="id", nullable=false)
+ @SuppressWarnings("unused")
+ private int id;
+
+ @Version
+ @Column(name="jpa_version")
+ @SuppressWarnings("unused")
+ private int jpaVersion;
+
+ @Basic
+ @Column(name="url")
+ private String url;
+
+ @Basic
+ @Column(name="charset")
+ private String charset;
+
+ @Basic
+ @Column(name="lang")
+ private String lang;
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="widget_id", referencedColumnName="id")
+ @SuppressWarnings("unused")
+ private WidgetImpl widget;
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.util.IInverseRelationship#updateInverseRelationship(java.lang.Object)
+ */
+ public void updateInverseRelationship(WidgetImpl owningObject)
+ {
+ widget = owningObject;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IStartFile#getCharset()
+ */
+ public String getCharset()
+ {
+ return charset;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IStartFile#setCharset(java.lang.String)
+ */
+ public void setCharset(String charset)
+ {
+ this.charset = charset;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IStartFile#getLang()
+ */
+ public String getLang()
+ {
+ return lang;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IStartFile#setLang(java.lang.String)
+ */
+ public void setLang(String lang)
+ {
+ this.lang = lang;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IStartFile#getUrl()
+ */
+ public String getUrl()
+ {
+ return url;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IStartFile#setUrl(java.lang.String)
+ */
+ public void setUrl(String url)
+ {
+ this.url = url;
+ }
+}
Added: incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/TokenImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/TokenImpl.java?rev=955236&view=auto
==============================================================================
--- incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/TokenImpl.java (added)
+++ incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/TokenImpl.java Wed Jun 16 14:16:36 2010
@@ -0,0 +1,185 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wookie.beans.jpa.impl;
+
+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.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+import org.apache.wookie.beans.IToken;
+import org.apache.wookie.beans.jpa.IInverseRelationship;
+
+/**
+ * TokenImpl - JPA IToken implementation.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+@Entity(name="Token")
+@Table(name="Token")
+public class TokenImpl implements IToken, IInverseRelationship<WidgetInstanceImpl>
+{
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ @Column(name="id", nullable=false)
+ @SuppressWarnings("unused")
+ private int id;
+
+ @Version
+ @Column(name="jpa_version")
+ @SuppressWarnings("unused")
+ private int jpaVersion;
+
+ @Basic(optional=false)
+ @Column(name="requestUrl", nullable=false)
+ private String requestUrl;
+
+ @Basic(optional=false)
+ @Column(name="accessUrl", nullable=false)
+ private String accessUrl;
+
+ @Basic(optional=false)
+ @Column(name="authzUrl", nullable=false)
+ private String authzUrl;
+
+ @Basic(optional=false)
+ @Column(name="requestToken", nullable=false)
+ private String requestToken;
+
+ @Basic(optional=false)
+ @Column(name="accessToken", nullable=false)
+ private String accessToken;
+
+ @Basic(optional=false)
+ @Column(name="tokenSecret", nullable=false)
+ private String tokenSecret;
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="widget_instance_id", referencedColumnName="id")
+ @SuppressWarnings("unused")
+ private WidgetInstanceImpl widgetInstance;
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.util.IInverseRelationship#updateInverseRelationship(java.lang.Object)
+ */
+ public void updateInverseRelationship(WidgetInstanceImpl owningObject)
+ {
+ widgetInstance = owningObject;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IToken#getAccessToken()
+ */
+ public String getAccessToken()
+ {
+ return accessToken;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IToken#setAccessToken(java.lang.String)
+ */
+ public void setAccessToken(String accessToken)
+ {
+ this.accessToken = accessToken;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IToken#getAccessUrl()
+ */
+ public String getAccessUrl()
+ {
+ return accessUrl;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IToken#setAccessUrl(java.lang.String)
+ */
+ public void setAccessUrl(String accessUrl)
+ {
+ this.accessUrl = accessUrl;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IToken#getAuthzUrl()
+ */
+ public String getAuthzUrl()
+ {
+ return authzUrl;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IToken#setAuthzUrl(java.lang.String)
+ */
+ public void setAuthzUrl(String authzUrl)
+ {
+ this.authzUrl = authzUrl;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IToken#getRequestToken()
+ */
+ public String getRequestToken()
+ {
+ return requestToken;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IToken#setRequestToken(java.lang.String)
+ */
+ public void setRequestToken(String requestToken)
+ {
+ this.requestToken = requestToken;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IToken#getRequestUrl()
+ */
+ public String getRequestUrl()
+ {
+ return requestUrl;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IToken#setRequestUrl(java.lang.String)
+ */
+ public void setRequestUrl(String requestUrl)
+ {
+ this.requestUrl = requestUrl;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IToken#getTokenSecret()
+ */
+ public String getTokenSecret()
+ {
+ return tokenSecret;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IToken#setTokenSecret(java.lang.String)
+ */
+ public void setTokenSecret(String tokenSecret)
+ {
+ this.tokenSecret = tokenSecret;
+ }
+}
Added: incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/WhitelistImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/WhitelistImpl.java?rev=955236&view=auto
==============================================================================
--- incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/WhitelistImpl.java (added)
+++ incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/WhitelistImpl.java Wed Jun 16 14:16:36 2010
@@ -0,0 +1,75 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wookie.beans.jpa.impl;
+
+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.Table;
+import javax.persistence.Version;
+
+import org.apache.wookie.beans.IWhitelist;
+
+/**
+ * WhitelistImpl - JPA IWhitelist implementation.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+@Entity(name="Whitelist")
+@Table(name="Whitelist")
+public class WhitelistImpl implements IWhitelist
+{
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ @Column(name="id", nullable=false)
+ private int id;
+
+ @Version
+ @Column(name="jpa_version")
+ @SuppressWarnings("unused")
+ private int jpaVersion;
+
+ @Basic(optional=false)
+ @Column(name="fUrl", nullable=false)
+ private String fUrl;
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWhitelist#getfUrl()
+ */
+ public String getfUrl()
+ {
+ return fUrl;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWhitelist#setfUrl(java.lang.String)
+ */
+ public void setfUrl(String url)
+ {
+ this.fUrl = url;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IBean#getId()
+ */
+ public Object getId()
+ {
+ return id;
+ }
+}
Added: incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/WidgetDefaultImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/WidgetDefaultImpl.java?rev=955236&view=auto
==============================================================================
--- incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/WidgetDefaultImpl.java (added)
+++ incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/WidgetDefaultImpl.java Wed Jun 16 14:16:36 2010
@@ -0,0 +1,91 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wookie.beans.jpa.impl;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+import org.apache.wookie.beans.IWidget;
+import org.apache.wookie.beans.IWidgetDefault;
+
+/**
+ * WidgetDefaultImpl - JPA IWidgetDefault implementation.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+@Entity(name="WidgetDefault")
+@Table(name="WidgetDefault")
+public class WidgetDefaultImpl implements IWidgetDefault
+{
+ @Id
+ @Column(name="widgetContext", nullable=false)
+ private String widgetContext;
+
+ @Version
+ @Column(name="jpa_version")
+ @SuppressWarnings("unused")
+ private int jpaVersion;
+
+ @ManyToOne(fetch=FetchType.LAZY, optional=false)
+ @JoinColumn(name="widgetId", referencedColumnName="id", nullable=false)
+ private WidgetImpl widget;
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IBean#getId()
+ */
+ public Object getId()
+ {
+ return widgetContext;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidgetDefault#getWidget()
+ */
+ public IWidget getWidget()
+ {
+ return widget;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidgetDefault#setWidget(org.apache.wookie.beans.IWidget)
+ */
+ public void setWidget(IWidget widget)
+ {
+ this.widget = (WidgetImpl)widget;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidgetDefault#getWidgetContext()
+ */
+ public String getWidgetContext()
+ {
+ return widgetContext;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidgetDefault#setWidgetContext(java.lang.String)
+ */
+ public void setWidgetContext(String widgetContext)
+ {
+ this.widgetContext = widgetContext;
+ }
+}
Added: incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/WidgetIconImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/WidgetIconImpl.java?rev=955236&view=auto
==============================================================================
--- incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/WidgetIconImpl.java (added)
+++ incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/WidgetIconImpl.java Wed Jun 16 14:16:36 2010
@@ -0,0 +1,145 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wookie.beans.jpa.impl;
+
+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.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+import org.apache.wookie.beans.IWidgetIcon;
+import org.apache.wookie.beans.jpa.IInverseRelationship;
+
+/**
+ * WidgetIconImpl - JPA IWidgetIcon implementation.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+@Entity(name="WidgetIcon")
+@Table(name="WidgetIcon")
+public class WidgetIconImpl implements IWidgetIcon, IInverseRelationship<WidgetImpl>
+{
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ @Column(name="id", nullable=false)
+ @SuppressWarnings("unused")
+ private int id;
+
+ @Version
+ @Column(name="jpa_version")
+ @SuppressWarnings("unused")
+ private int jpaVersion;
+
+ @Basic
+ @Column(name="src")
+ private String src;
+
+ @Basic
+ @Column(name="height")
+ private Integer height;
+
+ @Basic
+ @Column(name="width")
+ private Integer width;
+
+ @Basic
+ @Column(name="lang")
+ private String lang;
+
+ @ManyToOne(fetch=FetchType.LAZY)
+ @JoinColumn(name="widget_id", referencedColumnName="id")
+ @SuppressWarnings("unused")
+ private WidgetImpl widget;
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.util.IInverseRelationship#updateInverseRelationship(java.lang.Object)
+ */
+ public void updateInverseRelationship(WidgetImpl owningObject)
+ {
+ widget = owningObject;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidgetIcon#getHeight()
+ */
+ public Integer getHeight()
+ {
+ return height;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidgetIcon#setHeight(java.lang.Integer)
+ */
+ public void setHeight(Integer height)
+ {
+ this.height = height;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidgetIcon#getLang()
+ */
+ public String getLang()
+ {
+ return lang;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidgetIcon#setLang(java.lang.String)
+ */
+ public void setLang(String lang)
+ {
+ this.lang = lang;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidgetIcon#getSrc()
+ */
+ public String getSrc()
+ {
+ return src;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidgetIcon#setSrc(java.lang.String)
+ */
+ public void setSrc(String src)
+ {
+ this.src = src;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidgetIcon#getWidth()
+ */
+ public Integer getWidth()
+ {
+ return width;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidgetIcon#setWidth(java.lang.Integer)
+ */
+ public void setWidth(Integer width)
+ {
+ this.width = width;
+ }
+}
Added: incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/WidgetImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/WidgetImpl.java?rev=955236&view=auto
==============================================================================
--- incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/WidgetImpl.java (added)
+++ incubator/wookie/branches/pluggablepersistence/src/org/apache/wookie/beans/jpa/impl/WidgetImpl.java Wed Jun 16 14:16:36 2010
@@ -0,0 +1,561 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wookie.beans.jpa.impl;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.persistence.Basic;
+import javax.persistence.CascadeType;
+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.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.Version;
+
+import org.apache.openjpa.persistence.ElementDependent;
+
+import org.apache.wookie.beans.IDescription;
+import org.apache.wookie.beans.IFeature;
+import org.apache.wookie.beans.ILicense;
+import org.apache.wookie.beans.IName;
+import org.apache.wookie.beans.IPreferenceDefault;
+import org.apache.wookie.beans.ISharedData;
+import org.apache.wookie.beans.IStartFile;
+import org.apache.wookie.beans.IWidget;
+import org.apache.wookie.beans.IWidgetIcon;
+import org.apache.wookie.beans.IWidgetType;
+import org.apache.wookie.beans.jpa.InverseRelationshipCollection;
+
+/**
+ * WidgetImpl - JPA IWidget implementation.
+ *
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id$
+ */
+@Entity(name="Widget")
+@Table(name="Widget")
+@NamedQueries({@NamedQuery(name="WIDGET", query="SELECT w FROM Widget w WHERE w.guid = :guid"),
+ @NamedQuery(name="DEFAULT_WIDGET", query="SELECT w FROM WidgetDefault wd JOIN wd.widget w WHERE wd.widgetContext = :widgetContext"),
+ @NamedQuery(name="WIDGETS", query="SELECT w FROM Widget w JOIN w.widgetTypes wt WHERE wt.widgetContext = :widgetContext")})
+public class WidgetImpl implements IWidget
+{
+ @Id
+ @GeneratedValue(strategy=GenerationType.AUTO)
+ @Column(name="id", nullable=false)
+ private int id;
+
+ @Version
+ @Column(name="jpa_version")
+ @SuppressWarnings("unused")
+ private int jpaVersion;
+
+ @Basic
+ @Column(name="height")
+ private Integer height;
+
+ @Basic
+ @Column(name="width")
+ private Integer width;
+
+ @OneToMany(mappedBy="widget", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
+ @ElementDependent
+ private Collection<WidgetTypeImpl> widgetTypes;
+
+ @Basic(optional=false)
+ @Column(name="guid", nullable=false)
+ private String guid;
+
+ @Basic
+ @Column(name="widget_author")
+ private String widgetAuthor;
+
+ @Basic
+ @Column(name="widget_author_email")
+ private String widgetAuthorEmail;
+
+ @Basic
+ @Column(name="widget_author_href")
+ private String widgetAuthorHref;
+
+ @Basic
+ @Column(name="widget_version")
+ private String version;
+
+ @OneToMany(mappedBy="widget", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
+ @ElementDependent
+ private Collection<FeatureImpl> features;
+
+ @OneToMany(mappedBy="widget", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
+ @ElementDependent
+ private Collection<WidgetIconImpl> widgetIcons;
+
+ @OneToMany(mappedBy="widget", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
+ @ElementDependent
+ private Collection<LicenseImpl> licenses;
+
+ @OneToMany(mappedBy="widget", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
+ @ElementDependent
+ private Collection<NameImpl> names;
+
+ @OneToMany(mappedBy="widget", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
+ @ElementDependent
+ private Collection<DescriptionImpl> descriptions;
+
+ @OneToMany(mappedBy="widget", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
+ @ElementDependent
+ private Collection<StartFileImpl> startFiles;
+
+ @OneToMany(mappedBy="widget", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
+ @ElementDependent
+ private Collection<PreferenceDefaultImpl> preferenceDefaults;
+
+ @OneToMany(mappedBy="widget", fetch=FetchType.LAZY, cascade=CascadeType.ALL)
+ @ElementDependent
+ private Collection<SharedDataImpl> sharedData;
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getDescriptions()
+ */
+ public Collection<IDescription> getDescriptions()
+ {
+ if (descriptions == null)
+ {
+ descriptions = new ArrayList<DescriptionImpl>();
+ }
+ return new InverseRelationshipCollection<WidgetImpl,DescriptionImpl,IDescription>(this, descriptions);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#setDescriptions(java.util.Collection)
+ */
+ public void setDescriptions(Collection<IDescription> descriptions)
+ {
+ getDescriptions().clear();
+ if (descriptions != null)
+ {
+ for (IDescription description : descriptions)
+ {
+ getDescriptions().add((DescriptionImpl)description);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getFeatures()
+ */
+ public Collection<IFeature> getFeatures()
+ {
+ if (features == null)
+ {
+ features = new ArrayList<FeatureImpl>();
+ }
+ return new InverseRelationshipCollection<WidgetImpl,FeatureImpl,IFeature>(this, features);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#setFeatures(java.util.Collection)
+ */
+ public void setFeatures(Collection<IFeature> features)
+ {
+ getFeatures().clear();
+ if (features != null)
+ {
+ for (IFeature feature : features)
+ {
+ getFeatures().add((FeatureImpl)feature);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getGuid()
+ */
+ public String getGuid()
+ {
+ return guid;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#setGuid(java.lang.String)
+ */
+ public void setGuid(String guid)
+ {
+ this.guid = guid;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getHeight()
+ */
+ public Integer getHeight()
+ {
+ return height;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#setHeight(java.lang.Integer)
+ */
+ public void setHeight(Integer height)
+ {
+ this.height = height;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IBean#getId()
+ */
+ public Object getId()
+ {
+ return id;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getLicenses()
+ */
+ public Collection<ILicense> getLicenses()
+ {
+ if (licenses == null)
+ {
+ licenses = new ArrayList<LicenseImpl>();
+ }
+ return new InverseRelationshipCollection<WidgetImpl,LicenseImpl,ILicense>(this, licenses);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#setLicenses(java.util.Collection)
+ */
+ public void setLicenses(Collection<ILicense> licenses)
+ {
+ getLicenses().clear();
+ if (licenses != null)
+ {
+ for (ILicense license : licenses)
+ {
+ getLicenses().add((LicenseImpl)license);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getNames()
+ */
+ public Collection<IName> getNames()
+ {
+ if (names == null)
+ {
+ names = new ArrayList<NameImpl>();
+ }
+ return new InverseRelationshipCollection<WidgetImpl,NameImpl,IName>(this, names);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#setNames(java.util.Collection)
+ */
+ public void setNames(Collection<IName> names)
+ {
+ getNames().clear();
+ if (names != null)
+ {
+ for (IName name : names)
+ {
+ getNames().add((NameImpl)name);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getPreferenceDefaults()
+ */
+ public Collection<IPreferenceDefault> getPreferenceDefaults()
+ {
+ if (preferenceDefaults == null)
+ {
+ preferenceDefaults = new ArrayList<PreferenceDefaultImpl>();
+ }
+ return new InverseRelationshipCollection<WidgetImpl,PreferenceDefaultImpl,IPreferenceDefault>(this, preferenceDefaults);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#setPreferenceDefaults(java.util.Collection)
+ */
+ public void setPreferenceDefaults(Collection<IPreferenceDefault> preferenceDefaults)
+ {
+ getPreferenceDefaults().clear();
+ if (preferenceDefaults != null)
+ {
+ for (IPreferenceDefault preferenceDefault : preferenceDefaults)
+ {
+ getPreferenceDefaults().add((PreferenceDefaultImpl)preferenceDefault);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getSharedData()
+ */
+ public Collection<ISharedData> getSharedData()
+ {
+ if (sharedData == null)
+ {
+ sharedData = new ArrayList<SharedDataImpl>();
+ }
+ return new InverseRelationshipCollection<WidgetImpl,SharedDataImpl,ISharedData>(this, sharedData);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#setSharedData(java.util.Collection)
+ */
+ public void setSharedData(Collection<ISharedData> sharedData)
+ {
+ getSharedData().clear();
+ if (sharedData != null)
+ {
+ for (ISharedData data : sharedData)
+ {
+ getSharedData().add((SharedDataImpl)data);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getStartFiles()
+ */
+ public Collection<IStartFile> getStartFiles()
+ {
+ if (startFiles == null)
+ {
+ startFiles = new ArrayList<StartFileImpl>();
+ }
+ return new InverseRelationshipCollection<WidgetImpl,StartFileImpl,IStartFile>(this, startFiles);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#setStartFiles(java.util.Collection)
+ */
+ public void setStartFiles(Collection<IStartFile> startFiles)
+ {
+ getStartFiles().clear();
+ if (startFiles != null)
+ {
+ for (IStartFile startFile : startFiles)
+ {
+ getStartFiles().add((StartFileImpl)startFile);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getVersion()
+ */
+ public String getVersion()
+ {
+ return version;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#setVersion(java.lang.String)
+ */
+ public void setVersion(String version)
+ {
+ this.version = version;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getWidgetAuthor()
+ */
+ public String getWidgetAuthor()
+ {
+ return widgetAuthor;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#setWidgetAuthor(java.lang.String)
+ */
+ public void setWidgetAuthor(String widgetAuthor)
+ {
+ this.widgetAuthor = widgetAuthor;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getWidgetAuthorEmail()
+ */
+ public String getWidgetAuthorEmail()
+ {
+ return widgetAuthorEmail;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#setWidgetAuthorEmail(java.lang.String)
+ */
+ public void setWidgetAuthorEmail(String widgetAuthorEmail)
+ {
+ this.widgetAuthorEmail = widgetAuthorEmail;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getWidgetAuthorHref()
+ */
+ public String getWidgetAuthorHref()
+ {
+ return widgetAuthorHref;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#setWidgetAuthorHref(java.lang.String)
+ */
+ public void setWidgetAuthorHref(String widgetAuthorHref)
+ {
+ this.widgetAuthorHref = widgetAuthorHref;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getWidgetIcons()
+ */
+ public Collection<IWidgetIcon> getWidgetIcons()
+ {
+ if (widgetIcons == null)
+ {
+ widgetIcons = new ArrayList<WidgetIconImpl>();
+ }
+ return new InverseRelationshipCollection<WidgetImpl,WidgetIconImpl,IWidgetIcon>(this, widgetIcons);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#setWidgetIcons(java.util.Collection)
+ */
+ public void setWidgetIcons(Collection<IWidgetIcon> widgetIcons)
+ {
+ getWidgetIcons().clear();
+ if (widgetIcons != null)
+ {
+ for (IWidgetIcon widgetIcon : widgetIcons)
+ {
+ getWidgetIcons().add((WidgetIconImpl)widgetIcon);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getWidgetTypes()
+ */
+ public Collection<IWidgetType> getWidgetTypes()
+ {
+ if (widgetTypes == null)
+ {
+ widgetTypes = new ArrayList<WidgetTypeImpl>();
+ }
+ return new InverseRelationshipCollection<WidgetImpl,WidgetTypeImpl,IWidgetType>(this, widgetTypes);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#setWidgetTypes(java.util.Collection)
+ */
+ public void setWidgetTypes(Collection<IWidgetType> widgetTypes)
+ {
+ getWidgetTypes().clear();
+ if (widgetTypes != null)
+ {
+ for (IWidgetType widgetType : widgetTypes)
+ {
+ getWidgetTypes().add((WidgetTypeImpl)widgetType);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getWidth()
+ */
+ public Integer getWidth()
+ {
+ return width;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#setWidth(java.lang.Integer)
+ */
+ public void setWidth(Integer width)
+ {
+ this.width = width;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getSharedData(java.lang.String)
+ */
+ public ISharedData [] getSharedData(String sharedDataKey)
+ {
+ return Utilities.getSharedData(this, sharedDataKey);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getSharedData(java.lang.String, java.lang.String)
+ */
+ public ISharedData getSharedData(String sharedDataKey, String name)
+ {
+ return Utilities.getSharedData(this, sharedDataKey, name);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getWidgetDescription()
+ */
+ public String getWidgetDescription()
+ {
+ return Utilities.getWidgetDescription(this, "en");
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getWidgetShortName()
+ */
+ public String getWidgetShortName()
+ {
+ return Utilities.getWidgetShortName(this, "en");
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getWidgetTitle()
+ */
+ public String getWidgetTitle()
+ {
+ return Utilities.getWidgetTitle(this, "en");
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getWidgetTitle(java.lang.String)
+ */
+ public String getWidgetTitle(String locale)
+ {
+ return Utilities.getWidgetTitle(this, locale);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getUrl()
+ */
+ public String getUrl()
+ {
+ return Utilities.getUrl(this, "en");
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.wookie.beans.IWidget#getWidgetIconLocation()
+ */
+ public String getWidgetIconLocation()
+ {
+ return Utilities.getWidgetIconLocation(this, "en");
+ }
+}