001: // .//GEN-BEGIN:1_be
002: /******************************************************
003: * Code Generated From JAFFA Framework Default Pattern
004: *
005: * The JAFFA Project can be found at http://jaffa.sourceforge.net
006: * and is available under the Lesser GNU Public License
007: ******************************************************/package org.jaffa.persistence.domainobjects;
008:
009: import org.jaffa.metadata.*;
010: import java.util.*;
011:
012: // .//GEN-END:1_be
013: // Add additional imports//GEN-FIRST:imports
014:
015: // .//GEN-LAST:imports
016: // .//GEN-BEGIN:2_be
017: /** This class has the meta information for the Asset persistent class.
018: */
019: public class AssetMeta {
020:
021: // domain-object class name
022: private static String m_name = "org.jaffa.persistence.domainobjects.Asset";
023:
024: // token to be used for getting the label for the domain-object
025: private static String m_labelToken = "[label.App1.Material.Asset]";
026:
027: // Field constants
028: /** A constant to identity the AssetTk field.*/
029: public static final String ASSET_TK = "AssetTk";
030: /** A constant to identity the AssetId field.*/
031: public static final String ASSET_ID = "AssetId";
032: /** A constant to identity the Part field.*/
033: public static final String PART = "Part";
034: /** A constant to identity the Custodian field.*/
035: public static final String CUSTODIAN = "Custodian";
036: /** A constant to identity the Condition field.*/
037: public static final String CONDITION = "Condition";
038: /** A constant to identity the CreatedDatetime field.*/
039: public static final String CREATED_DATETIME = "CreatedDatetime";
040: /** A constant to identity the Qty field.*/
041: public static final String QTY = "Qty";
042: /** A constant to identity the KeyRef field.*/
043: public static final String KEY_REF = "KeyRef";
044:
045: // Meta Data Definitions
046:
047: /** A constant which holds the meta information for the AssetTk field.*/
048: public static final FieldMetaData META_ASSET_TK = new IntegerFieldMetaData(
049: ASSET_TK, "[label.App1.Material.Asset.AssetTk]",
050: Boolean.FALSE, null, null, null, new Integer(20));
051:
052: /** A constant which holds the meta information for the AssetId field.*/
053: public static final FieldMetaData META_ASSET_ID = new StringFieldMetaData(
054: ASSET_ID, "[label.App1.Material.Asset.AssetId]",
055: Boolean.FALSE, null, new Integer(50),
056: FieldMetaData.UPPER_CASE);
057:
058: /** A constant which holds the meta information for the Part field.*/
059: public static final FieldMetaData META_PART = new StringFieldMetaData(
060: PART, "[label.App1.Material.Asset.Part]", Boolean.FALSE,
061: null, new Integer(50), FieldMetaData.UPPER_CASE);
062:
063: /** A constant which holds the meta information for the Custodian field.*/
064: public static final FieldMetaData META_CUSTODIAN = new StringFieldMetaData(
065: CUSTODIAN, "[label.App1.Material.Asset.Sc]", Boolean.FALSE,
066: null, new Integer(50), FieldMetaData.UPPER_CASE);
067:
068: /** A constant which holds the meta information for the Condition field.*/
069: public static final FieldMetaData META_CONDITION = new StringFieldMetaData(
070: CONDITION, "[label.App1.Material.Asset.Condition]",
071: Boolean.FALSE, null, new Integer(20),
072: FieldMetaData.UPPER_CASE);
073:
074: /** A constant which holds the meta information for the CreatedDatetime field.*/
075: public static final FieldMetaData META_CREATED_DATETIME = new DateTimeFieldMetaData(
076: CREATED_DATETIME,
077: "[label.App1.Material.Asset.CreatedDatetime]",
078: Boolean.FALSE, null, null, null);
079:
080: /** A constant which holds the meta information for the Qty field.*/
081: public static final FieldMetaData META_QTY = new IntegerFieldMetaData(
082: QTY, "[label.App1.Material.Asset.Qty]", Boolean.FALSE,
083: null, null, null, new Integer(8));
084:
085: /** A constant which holds the meta information for the KeyRef field.*/
086: public static final FieldMetaData META_KEY_REF = new StringFieldMetaData(
087: KEY_REF, "[label.App1.Material.Asset.KeyRef]",
088: Boolean.FALSE, null, new Integer(50),
089: FieldMetaData.UPPER_CASE);
090:
091: // Map of FieldConstants + MetaDataDefinitions
092: private static Map m_fieldMap = new HashMap();
093: static {
094: m_fieldMap.put(ASSET_TK, META_ASSET_TK);
095: m_fieldMap.put(ASSET_ID, META_ASSET_ID);
096: m_fieldMap.put(PART, META_PART);
097: m_fieldMap.put(CUSTODIAN, META_CUSTODIAN);
098: m_fieldMap.put(CONDITION, META_CONDITION);
099: m_fieldMap.put(CREATED_DATETIME, META_CREATED_DATETIME);
100: m_fieldMap.put(QTY, META_QTY);
101: m_fieldMap.put(KEY_REF, META_KEY_REF);
102: }
103:
104: // List of MetaDataDefinitions for key fields
105: private static List m_keyFields = new LinkedList();
106: static {
107: m_keyFields.add(META_ASSET_TK);
108: }
109:
110: // List of MetaDataDefinitions for mandatory fields
111: private static List m_mandatoryFields = new LinkedList();
112: static {
113: }
114:
115: /** Returns the name of the persistent class.
116: * @return the name of the persistent class.
117: */
118: public static String getName() {
119: return m_name;
120: }
121:
122: /** Getter for property labelToken.
123: * @return Value of property labelToken.
124: */
125: public static String getLabelToken() {
126: return m_labelToken;
127: }
128:
129: /** This returns an array of all the fields of the persistent class.
130: * @return an array of all the fields of the persistent class.
131: */
132: public static String[] getAttributes() {
133: return DomainMetaDataHelper.getAttributes(m_fieldMap);
134: }
135:
136: /** This returns an array of meta information for all the fields of the persistent class.
137: * @return an array of meta information for all the fields of the persistent class.
138: */
139: public static FieldMetaData[] getFieldMetaData() {
140: return DomainMetaDataHelper.getFieldMetaData(m_fieldMap);
141: }
142:
143: /** This returns meta information for the input field.
144: * @param fieldName the field name.
145: * @return meta information for the input field.
146: */
147: public static FieldMetaData getFieldMetaData(String fieldName) {
148: return DomainMetaDataHelper.getFieldMetaData(m_fieldMap,
149: fieldName);
150: }
151:
152: /** This returns an array of meta information for all the key fields of the persistent class.
153: * @return an array of meta information for all the key fields of the persistent class.
154: */
155: public static FieldMetaData[] getKeyFields() {
156: return (FieldMetaData[]) m_keyFields
157: .toArray(new FieldMetaData[0]);
158: }
159:
160: /** This returns an array of meta information for all the mandatory fields of the persistent class.
161: * @return an array of meta information for all the mandatory fields of the persistent class.
162: */
163: public static FieldMetaData[] getMandatoryFields() {
164: return (FieldMetaData[]) m_mandatoryFields
165: .toArray(new FieldMetaData[0]);
166: }
167:
168: // .//GEN-END:2_be
169: // All the custom code goes here//GEN-FIRST:custom
170:
171: // .//GEN-LAST:custom
172: }
|