001: /**********************************************************************
002: Copyright (c) 2007 Erik Bengtson and others. All rights reserved.
003: Licensed under the Apache License, Version 2.0 (the "License");
004: you may not use this file except in compliance with the License.
005: You may obtain a copy of the License at
006:
007: http://www.apache.org/licenses/LICENSE-2.0
008:
009: Unless required by applicable law or agreed to in writing, software
010: distributed under the License is distributed on an "AS IS" BASIS,
011: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012: See the License for the specific language governing permissions and
013: limitations under the License.
014:
015:
016: Contributors:
017: ...
018: **********************************************************************/package org.jpox.metadata;
019:
020: /**
021: * Factory for ClassMetaData, InterfaceMetaData, FieldMetaData and PropertyMetaData objects.
022: * @version $Revision: 1.6 $
023: */
024: public interface MetaDataFactory {
025: /**
026: * Constructor for an InterfaceMetaData.
027: * Takes the basic string information found in the XML/annotations.
028: * @param pmd MetaData for the package that this class belongs to
029: * @param name Name of class
030: * @param identityType Type of identity
031: * @param objectidClass Class of the object id
032: * @param requiresExtent Whether the class requires an extent
033: * @param detachable Whether this is detachable
034: * @param embeddedOnly embedded-only tag
035: * @param catalog Name for catalog
036: * @param schema Name for schema
037: * @param table Name of the table where to persist objects of this type
038: * @param entityName the entity name required by JPA §4.3.1
039: */
040: public abstract InterfaceMetaData newInterfaceObject(
041: final PackageMetaData pmd, final String name,
042: final String identityType, final String objectidClass,
043: final String requiresExtent, final String detachable,
044: final String embeddedOnly, final String catalog,
045: final String schema, final String table,
046: final String entityName);
047:
048: /**
049: * Constructor for a ClassMetaData.
050: * Takes the basic string information found in the XML/annotations.
051: * @param pmd MetaData for the package that this class belongs to
052: * @param name Name of class
053: * @param identityType Type of identity
054: * @param objectidClass Class of the object id
055: * @param requiresExtent Whether the class requires an extent
056: * @param detachable Whether this is detachable
057: * @param embeddedOnly embedded-only tag
058: * @param modifier persistence modifier for the class
059: * @param persistenceCapableSuperclass PC superclass (optional)
060: * @param catalog Name for catalog
061: * @param schema Name for schema
062: * @param table Name of the table where to persist objects of this type
063: * @param entityName the entity name required by JPA §4.3.1
064: */
065: public abstract ClassMetaData newClassObject(
066: final PackageMetaData pmd, final String name,
067: final String identityType, final String objectidClass,
068: final String requiresExtent, final String detachable,
069: final String embeddedOnly, final String modifier,
070: final String persistenceCapableSuperclass,
071: final String catalog, final String schema,
072: final String table, final String entityName);
073:
074: /**
075: * Constructor for a FieldMetaData.
076: * @param md MetaData for the class that this field belongs to
077: * @param name Name of the field
078: * @param pk Whether it is a part of the PK
079: * @param modifier persistence-modifier
080: * @param defaultFetchGroup Whether it is in the DFG
081: * @param nullValue Action on null value inserts
082: * @param embedded Whether it is embedded
083: * @param serialized Whether it is serialised
084: * @param dependent Whether it is dependent for deletes
085: * @param mappedBy Field in other class that it is mapped using
086: * @param column Column name to store it
087: * @param table Table where it is stored
088: * @param catalog Catalog that the table is in
089: * @param schema Schema that the table is in
090: * @param deleteAction Any FK delete action
091: * @param indexed Whether it is indexed
092: * @param unique Whether it is unique
093: * @param recursionDepth Recursion depth to apply on fetch-plan operations
094: * @param loadFetchGroup Whether to load the fetch group
095: * @param valueStrategy Strategy for generating values for this field
096: * @param sequence Sequence name if the strategy is "sequence"
097: * @param fieldType Type of the field
098: * @return MetaData for the field
099: */
100: public abstract FieldMetaData newFieldObject(final MetaData md,
101: final String name, final String pk, final String modifier,
102: final String defaultFetchGroup, final String nullValue,
103: final String embedded, final String serialized,
104: final String dependent, final String mappedBy,
105: final String column, final String table,
106: final String catalog, final String schema,
107: final String deleteAction, final String indexed,
108: final String unique, final String recursionDepth,
109: final String loadFetchGroup, final String valueStrategy,
110: final String sequence, final String fieldType);
111:
112: /**
113: * Constructor for a FieldMetaData copying the supplied FieldMetaData.
114: * @param md Parent MetaData
115: * @param referenceFmd FieldMetaData to copy.
116: * @return The new FieldMetaData
117: */
118: public abstract FieldMetaData newFieldObject(MetaData md,
119: AbstractMemberMetaData referenceFmd);
120:
121: /**
122: * Constructor for a PropertyMetaData.
123: * @param md MetaData for the interface that this property belongs to
124: * @param name Name of the field
125: * @param pk Whether it is a part of the PK
126: * @param modifier persistence-modifier
127: * @param defaultFetchGroup Whether it is in the DFG
128: * @param nullValue Action on null value inserts
129: * @param embedded Whether it is embedded
130: * @param serialized Whether it is serialised
131: * @param dependent Whether it is dependent for deletes
132: * @param mappedBy Field in other class that it is mapped using
133: * @param column Column name to store it
134: * @param table Table where it is stored
135: * @param catalog Catalog that the table is in
136: * @param schema Schema that the table is in
137: * @param deleteAction Any FK delete action
138: * @param indexed Whether it is indexed
139: * @param unique Whether it is unique
140: * @param recursionDepth Recursion depth to apply on fetch-plan operations
141: * @param loadFetchGroup Whether to load the fetch group
142: * @param valueStrategy Strategy for generating values for this field
143: * @param sequence Sequence name if the strategy is "sequence"
144: * @param fieldType Type of the field
145: * @param fieldName Name of the field (relates to the implementation of this)
146: * @return MetaData for the field
147: */
148: public abstract PropertyMetaData newPropertyObject(
149: final MetaData md, final String name, final String pk,
150: final String modifier, final String defaultFetchGroup,
151: final String nullValue, final String embedded,
152: final String serialized, final String dependent,
153: final String mappedBy, final String column,
154: final String table, final String catalog,
155: final String schema, final String deleteAction,
156: final String indexed, final String unique,
157: final String recursionDepth, final String loadFetchGroup,
158: final String valueStrategy, final String sequence,
159: final String fieldType, final String fieldName);
160:
161: /**
162: * Constructor for a PropertyMetaData copying the supplied PropertyMetaData.
163: * @param md Parent MetaData
164: * @param referencePmd PropertyMetaData to copy.
165: * @return The new PropertyMetaData
166: */
167: public abstract PropertyMetaData newPropertyObject(MetaData md,
168: PropertyMetaData referencePmd);
169: }
|