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 Part persistent class.
018: */
019: public class PartMeta {
020:
021: // domain-object class name
022: private static String m_name = "org.jaffa.persistence.domainobjects.Part";
023:
024: // token to be used for getting the label for the domain-object
025: private static String m_labelToken = "[label.App1.Catalog.Part]";
026:
027: // Field constants
028: /** A constant to identity the Part field.*/
029: public static final String PART = "Part";
030: /** A constant to identity the Noun field.*/
031: public static final String NOUN = "Noun";
032: /** A constant to identity the CategoryInstrument field.*/
033: public static final String CATEGORY_INSTRUMENT = "CategoryInstrument";
034:
035: // Meta Data Definitions
036:
037: /** A constant which holds the meta information for the Part field.*/
038: public static final FieldMetaData META_PART = new StringFieldMetaData(
039: PART, "[label.App1.Catalog.Part.Part]", Boolean.TRUE, null,
040: new Integer(50), FieldMetaData.UPPER_CASE);
041:
042: /** A constant which holds the meta information for the Noun field.*/
043: public static final FieldMetaData META_NOUN = new StringFieldMetaData(
044: NOUN, "[label.App1.Catalog.Part.Noun]", Boolean.TRUE, null,
045: new Integer(40), FieldMetaData.UPPER_CASE);
046:
047: /** A constant which holds the meta information for the CategoryInstrument field.*/
048: public static final FieldMetaData META_CATEGORY_INSTRUMENT = new StringFieldMetaData(
049: CATEGORY_INSTRUMENT,
050: "[label.App1.Catalog.Part.CategoryInstrument]",
051: Boolean.FALSE, null, new Integer(20),
052: FieldMetaData.UPPER_CASE);
053:
054: // Map of FieldConstants + MetaDataDefinitions
055: private static Map m_fieldMap = new HashMap();
056: static {
057: m_fieldMap.put(PART, META_PART);
058: m_fieldMap.put(NOUN, META_NOUN);
059: m_fieldMap.put(CATEGORY_INSTRUMENT, META_CATEGORY_INSTRUMENT);
060: }
061:
062: // List of MetaDataDefinitions for key fields
063: private static List m_keyFields = new LinkedList();
064: static {
065: m_keyFields.add(META_PART);
066: }
067:
068: // List of MetaDataDefinitions for mandatory fields
069: private static List m_mandatoryFields = new LinkedList();
070: static {
071: m_mandatoryFields.add(META_PART);
072: m_mandatoryFields.add(META_NOUN);
073: }
074:
075: /** Returns the name of the persistent class.
076: * @return the name of the persistent class.
077: */
078: public static String getName() {
079: return m_name;
080: }
081:
082: /** Getter for property labelToken.
083: * @return Value of property labelToken.
084: */
085: public static String getLabelToken() {
086: return m_labelToken;
087: }
088:
089: /** This returns an array of all the fields of the persistent class.
090: * @return an array of all the fields of the persistent class.
091: */
092: public static String[] getAttributes() {
093: return DomainMetaDataHelper.getAttributes(m_fieldMap);
094: }
095:
096: /** This returns an array of meta information for all the fields of the persistent class.
097: * @return an array of meta information for all the fields of the persistent class.
098: */
099: public static FieldMetaData[] getFieldMetaData() {
100: return DomainMetaDataHelper.getFieldMetaData(m_fieldMap);
101: }
102:
103: /** This returns meta information for the input field.
104: * @param fieldName the field name.
105: * @return meta information for the input field.
106: */
107: public static FieldMetaData getFieldMetaData(String fieldName) {
108: return DomainMetaDataHelper.getFieldMetaData(m_fieldMap,
109: fieldName);
110: }
111:
112: /** This returns an array of meta information for all the key fields of the persistent class.
113: * @return an array of meta information for all the key fields of the persistent class.
114: */
115: public static FieldMetaData[] getKeyFields() {
116: return (FieldMetaData[]) m_keyFields
117: .toArray(new FieldMetaData[0]);
118: }
119:
120: /** This returns an array of meta information for all the mandatory fields of the persistent class.
121: * @return an array of meta information for all the mandatory fields of the persistent class.
122: */
123: public static FieldMetaData[] getMandatoryFields() {
124: return (FieldMetaData[]) m_mandatoryFields
125: .toArray(new FieldMetaData[0]);
126: }
127:
128: // .//GEN-END:2_be
129: // All the custom code goes here//GEN-FIRST:custom
130:
131: // .//GEN-LAST:custom
132: }
|