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: /*
019: * RollerConfigProperty.java
020: *
021: * Created on April 20, 2005, 2:58 PM
022: */
023:
024: package org.apache.roller.pojos;
025:
026: /**
027: * This POJO represents a single property of the roller system.
028: *
029: * @author Allen Gilliland
030: *
031: * @ejb:bean name="RollerPropertyData"
032: * @hibernate.class lazy="false" table="roller_properties"
033: * @hibernate.cache usage="read-write"
034: */
035: public class RollerPropertyData extends
036: org.apache.roller.pojos.PersistentObject implements
037: java.io.Serializable {
038:
039: static final long serialVersionUID = 6913562779484028899L;
040:
041: /**
042: * Holds value of property name.
043: */
044: private String name;
045:
046: /**
047: * Holds value of property value.
048: */
049: private String value;
050:
051: public RollerPropertyData() {
052: }
053:
054: public RollerPropertyData(String name, String value) {
055: this .name = name;
056: this .value = value;
057: }
058:
059: public void setData(PersistentObject object) {
060: if (object instanceof RollerPropertyData) {
061: RollerPropertyData prop = (RollerPropertyData) object;
062: this .name = prop.getName();
063: this .value = prop.getValue();
064: }
065: }
066:
067: public String toString() {
068: return (this .name + "=" + this .value);
069: }
070:
071: /**
072: * Getter for property name.
073: *
074: * @return Value of property name.
075: * @ejb:persistent-field
076: * @hibernate.id column="name" generator-class="assigned"
077: */
078: public String getName() {
079:
080: return this .name;
081: }
082:
083: /**
084: * Setter for property name.
085: *
086: * @param name New value of property name.
087: * @ejb:persistent-field
088: */
089: public void setName(String name) {
090:
091: this .name = name;
092: }
093:
094: /**
095: * Getter for property value.
096: *
097: * @return Value of property value.
098: * @ejb:persistent-field
099: * @hibernate.property column="value" non-null="false" unique="false"
100: */
101: public String getValue() {
102:
103: return this .value;
104: }
105:
106: /**
107: * Setter for property value.
108: *
109: * @param value New value of property value.
110: * @ejb:persistent-field
111: */
112: public void setValue(String value) {
113:
114: this .value = value;
115: }
116:
117: public String getId() {
118: // this is only here because it is required by PersistentObject
119: return null;
120: }
121:
122: public void setId(String id) {
123: // do nothing ... only here because the PersistentObject class requires it
124: }
125: }
|