001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. The ASF licenses this file to You
004: * under the Apache License, Version 2.0 (the "License"); you may not
005: * use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License. For additional information regarding
015: * copyright in this work, please see the NOTICE file in the top level
016: * directory of this distribution.
017: */
018: package org.apache.roller.pojos;
019:
020: /**
021: * @author David M Johnson
022: * @ejb:bean name="EntryAttribute"
023: * @hibernate.class lazy="false" table="entryattribute"
024: * @hibernate.cache usage="read-write"
025: */
026: public class EntryAttributeData extends PersistentObject implements
027: java.lang.Comparable {
028: private String id;
029: private WeblogEntryData entry;
030: private String name;
031: private String value;
032:
033: public EntryAttributeData() {
034: }
035:
036: public EntryAttributeData(String id, WeblogEntryData entry,
037: String name, String value) {
038: this .id = id;
039: this .entry = entry;
040: this .name = name;
041: this .value = value;
042: }
043:
044: public EntryAttributeData(EntryAttributeData otherData) {
045: setData(otherData);
046: }
047:
048: /**
049: * @roller.wrapPojoMethod type="simple"
050: * @ejb:persistent-field
051: * @hibernate.id column="id"
052: * generator-class="uuid.hex" unsaved-value="null"
053: */
054: public java.lang.String getId() {
055: return this .id;
056: }
057:
058: /** @ejb:persistent-field */
059: public void setId(java.lang.String id) {
060: this .id = id;
061: }
062:
063: /**
064: * Setter is needed in RollerImpl.storePersistentObject()
065: */
066: public void setData(
067: org.apache.roller.pojos.PersistentObject otherData) {
068: this .id = otherData.getId();
069: this .entry = ((EntryAttributeData) otherData).getEntry();
070: this .name = ((EntryAttributeData) otherData).getName();
071: this .value = ((EntryAttributeData) otherData).getValue();
072: }
073:
074: /**
075: * @roller.wrapPojoMethod type="pojo"
076: * @ejb:persistent-field
077: * @hibernate.many-to-one column="entryid" cascade="none" not-null="true"
078: */
079: public WeblogEntryData getEntry() {
080: return entry;
081: }
082:
083: /** @ejb:persistent-field */
084: public void setEntry(WeblogEntryData entry) {
085: this .entry = entry;
086: }
087:
088: /**
089: * @roller.wrapPojoMethod type="simple"
090: * @ejb:persistent-field
091: * @hibernate.property column="name" non-null="true" unique="false"
092: */
093: public String getName() {
094: return name;
095: }
096:
097: /** @ejb:persistent-field */
098: public void setName(String name) {
099: this .name = name;
100: }
101:
102: /**
103: * @roller.wrapPojoMethod type="simple"
104: * @ejb:persistent-field
105: * @hibernate.property column="value" non-null="true" unique="false"
106: */
107: public String getValue() {
108: return value;
109: }
110:
111: /** @ejb:persistent-field */
112: public void setValue(String value) {
113: this .value = value;
114: }
115:
116: public int compareTo(Object o) {
117: EntryAttributeData att = (EntryAttributeData) o;
118: return getName().compareTo(att.getName());
119: }
120: }
|