001: /**
002: * GENERATED CODE: DO NOT MODIFY IT UNDER ANY CIRCUMSTANCES!!!
003: */package com.odal.petstore.persistence.gen.pos;
004:
005: import com.completex.objective.components.persistency.key.impl.DefaultNaturalKeyFactory;
006: import java.util.Date;
007: import java.util.HashMap;
008: import java.util.Map;
009: import java.io.InputStream;
010: import java.math.BigDecimal;
011: import java.math.BigInteger;
012: import java.sql.Clob;
013: import java.sql.Blob;
014: import com.completex.objective.components.persistency.*;
015: import com.completex.objective.components.persistency.key.impl.DefaultNaturalKeyFactory;
016:
017: public class BannerDataPO extends PersistentObject implements
018: java.io.Externalizable {
019: //
020: // Complex object related:
021: //
022:
023: //
024: private static Map registeredMasters;
025: private static Object lock = new Object();
026:
027: protected Object classLock() {
028: return lock;
029: }
030:
031: protected void instantiateRegisteredMasters() {
032: if (registeredMasters == null) {
033: synchronized (lock) {
034: if (registeredMasters == null) {
035: registeredMasters = new HashMap();
036: }
037: }
038: }
039: }
040:
041: protected Map registeredMasters() {
042: return registeredMasters;
043: }
044:
045: //
046: //
047: //
048:
049: public static final String TABLE_BANNER_DATA = "BANNER_DATA";
050:
051: public BannerDataPO() {
052: super (new Record(table));
053: }
054:
055: public BannerDataPO(String favCategory) {
056: this ();
057: setFavCategory(favCategory);
058: }
059:
060: public static final String COL_FAV_CATEGORY = "FAV_CATEGORY";
061: public static final String TCOL_FAV_CATEGORY = "BANNER_DATA.FAV_CATEGORY";
062: public static final int ICOL_FAV_CATEGORY = 0;
063: public static final int JDBC_TYPE_FAV_CATEGORY = 12;
064:
065: public static final String COL_BANNER_NAME = "BANNER_NAME";
066: public static final String TCOL_BANNER_NAME = "BANNER_DATA.BANNER_NAME";
067: public static final int ICOL_BANNER_NAME = 1;
068: public static final int JDBC_TYPE_BANNER_NAME = 12;
069:
070: private static final MetaTable table = new MetaTable("BANNER_DATA",
071: "BANNER_DATA", 2, 1);
072:
073: static {
074: table.setStaticFinal(true);
075: //
076: // Meta Foreign Keys:
077: //
078: //
079: // Meta Natural Key:
080: //
081: // naturalKey has no context
082:
083: //
084: // Meta Columns:
085: //
086:
087: final MetaColumn metaFavCategory = new MetaColumn(
088: ICOL_FAV_CATEGORY, "FAV_CATEGORY", "FAV_CATEGORY",
089: table);
090: metaFavCategory.setPrimaryKey(true);
091: metaFavCategory.setRequired(true);
092: metaFavCategory.setOptimisticLock(false);
093: metaFavCategory.setType(ColumnType.STRING);
094: metaFavCategory.setColumnSize(80);
095: metaFavCategory.setRemarks("");
096: metaFavCategory.setDecimalDigits(0);
097: metaFavCategory.setAutoGenerated(false);
098: metaFavCategory.setAutoIncrement(false);
099: metaFavCategory.setJdbcType(12);
100: table.addToPrimaryKey(new Integer(ICOL_FAV_CATEGORY));
101: table.addColumn(metaFavCategory);
102:
103: final MetaColumn metaBannerName = new MetaColumn(
104: ICOL_BANNER_NAME, "BANNER_NAME", "BANNER_NAME", table);
105: metaBannerName.setPrimaryKey(false);
106: metaBannerName.setRequired(false);
107: metaBannerName.setOptimisticLock(false);
108: metaBannerName.setType(ColumnType.STRING);
109: metaBannerName.setColumnSize(255);
110: metaBannerName.setRemarks("");
111: metaBannerName.setDecimalDigits(0);
112: metaBannerName.setAutoGenerated(false);
113: metaBannerName.setAutoIncrement(false);
114: metaBannerName.setJdbcType(12);
115: table.addColumn(metaBannerName);
116:
117: }
118:
119: private String favCategory;
120: private String bannerName;
121:
122: //
123: // favCategory:
124: //
125: public String getFavCategory() {
126: return this .favCategory;
127: }
128:
129: public void setFavCategory(String favCategory) {
130: if (record2().setObject(ICOL_FAV_CATEGORY, favCategory)) {
131: this .favCategory = favCategory;
132: }
133: }
134:
135: public boolean izNullFavCategory() {
136: return record2().getObject(ICOL_FAV_CATEGORY) == null;
137: }
138:
139: public void setNullFavCategory() {
140: if (record2().setObject(ICOL_FAV_CATEGORY, null)) {
141: this .favCategory = null;
142: }
143: }
144:
145: //
146: // bannerName:
147: //
148: public String getBannerName() {
149: return this .bannerName;
150: }
151:
152: public void setBannerName(String bannerName) {
153: if (record2().setObject(ICOL_BANNER_NAME, bannerName)) {
154: this .bannerName = bannerName;
155: }
156: }
157:
158: public boolean izNullBannerName() {
159: return record2().getObject(ICOL_BANNER_NAME) == null;
160: }
161:
162: public void setNullBannerName() {
163: if (record2().setObject(ICOL_BANNER_NAME, null)) {
164: this .bannerName = null;
165: }
166: }
167:
168: public void toBeanFields() {
169: toBeanFields(this );
170: }
171:
172: public void toBeanFields(PersistentObject from) {
173: favCategory = (String) from.record2().getObject(
174: ICOL_FAV_CATEGORY);
175: bannerName = (String) from.record2()
176: .getObject(ICOL_BANNER_NAME);
177: super .toBeanFields(from);
178: }
179:
180: public void fromBeanFields(PersistentObject persistentObject) {
181: BannerDataPO from = (BannerDataPO) persistentObject;
182: record2().getEntry(ICOL_FAV_CATEGORY).setUnmarkedValue(
183: from.favCategory, from.favCategory);
184: record2().getEntry(ICOL_BANNER_NAME).setUnmarkedValue(
185: from.bannerName, from.bannerName);
186: super .fromBeanFieldsDataSaved(persistentObject);
187: }
188:
189: public String toString() {
190:
191: StringBuffer buffer = new StringBuffer();
192: buffer.append("{ " + "class = ").append(
193: this .getClass().getName()).append(" " + "table = ")
194: .append(TABLE_BANNER_DATA).append(" columns = {");
195:
196: if (record() != null) {
197: buffer.append(COL_FAV_CATEGORY).append(" = ").append(
198: record().getObject(ICOL_FAV_CATEGORY)).append(" ");
199: buffer.append(COL_BANNER_NAME).append(" = ").append(
200: record().getObject(ICOL_BANNER_NAME)).append(" ");
201: } else {
202: buffer.append(COL_FAV_CATEGORY).append(" = ").append(
203: favCategory).append(" ");
204: buffer.append(COL_BANNER_NAME).append(" = ").append(
205: bannerName).append(" ");
206: }
207: buffer.append("}}");
208: return buffer.toString();
209: }
210:
211: // naturalKey has no context
212:
213: /**
214: * Equals by Basic Peristent object fields (without children objects)
215: */
216: public boolean equalsBasic(Object value) {
217: if (this == value)
218: return true;
219: if (value == null || getClass() != value.getClass())
220: return false;
221:
222: BannerDataPO that = (BannerDataPO) value;
223:
224: if (favCategory != null ? !favCategory.equals(that.favCategory)
225: : that.favCategory != null)
226: return false;
227: if (bannerName != null ? !bannerName.equals(that.bannerName)
228: : that.bannerName != null)
229: return false;
230: return true;
231: }
232:
233: /**
234: * hashCode by Basic Peristent object fields (without children objects)
235: */
236: public int hashCodeBasic() {
237: int result;
238: long temp;
239: result = (favCategory != null ? favCategory.hashCode() : 0);
240: result = 29 * result
241: + (bannerName != null ? bannerName.hashCode() : 0);
242:
243: return result;
244: }
245: }
|