You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-commits@db.apache.org by an...@apache.org on 2008/12/07 19:52:56 UTC

svn commit: r724172 [1/2] - /db/jdo/trunk/api2/src/java/javax/jdo/metadata/

Author: andyj
Date: Sun Dec  7 10:52:55 2008
New Revision: 724172

URL: http://svn.apache.org/viewvc?rev=724172&view=rev
Log:
JDO-615 Initial version of JDO metadata. Should correspond to all comments on the patches posted on JDO-615 in JIRA. Not included PMF methods in this commit since that will break compilation of any implementation that doesn't yet have those new methods

Added:
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/ArrayMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/ClassMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/ClassPersistenceModifier.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/CollectionMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/ColumnMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/ComponentMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/DatastoreIdentityMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/DiscriminatorMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/ElementMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/EmbeddedMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/ExtensionMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/FetchGroupMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/FetchPlanMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/FieldMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/ForeignKeyMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/IndexMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/Indexed.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/InheritanceMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/InterfaceMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/JDOMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/JoinMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/KeyMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/MapMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/MemberMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/Metadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/OrderMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/PackageMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/PrimaryKeyMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/PropertyMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/QueryMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/SequenceMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/UniqueMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/ValueMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/VersionMetadata.java
    db/jdo/trunk/api2/src/java/javax/jdo/metadata/package.html

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/ArrayMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/ArrayMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/ArrayMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/ArrayMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+/**
+ * Represents details of an array in a field/property in a class.
+ * @since 2.3
+ */
+public interface ArrayMetadata extends Metadata {
+    /**
+     * Method to set the name of the element type
+     * 
+     * @param type Name of the element type
+     */
+    void setElementType(String type);
+
+    /**
+     * Accessor for the element type
+     * 
+     * @return The element type
+     */
+    String getElementType();
+
+    /**
+     * Method to set whether the element is embedded
+     * 
+     * @param val Whether it is embedded
+     */
+    void setEmbeddedElement(boolean val);
+
+    /**
+     * Accessor for whether the element is embedded
+     * 
+     * @return whether the element is embedded
+     */
+    Boolean getEmbeddedElement();
+
+    /**
+     * Method to set whether the element is serialised
+     * 
+     * @param val Whether it is serialised
+     */
+    void setSerializedElement(boolean val);
+
+    /**
+     * Accessor for whether the element is serialised
+     * 
+     * @return whether the element is serialised
+     */
+    Boolean getSerializedElement();
+
+    /**
+     * Method to set whether the element is dependent
+     * 
+     * @param val Whether it is dependent
+     */
+    void setDependentElement(boolean val);
+
+    /**
+     * Accessor for whether the element is dependent
+     * 
+     * @return whether the element is dependent
+     */
+    Boolean getDependentElement();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/ClassMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/ClassMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/ClassMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/ClassMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+/**
+ * Represents a class.
+ * @since 2.3
+ */
+public interface ClassMetadata extends ComponentMetadata {
+    /**
+     * Method to define the persistence modifier.
+     * @param mod persistence modifier
+     */
+    void setPersistenceModifier(ClassPersistenceModifier mod);
+
+    /**
+     * Accessor for the persistence modifier.
+     * @return persistence modifier
+     */
+    ClassPersistenceModifier getPersistenceModifier();
+
+    /**
+     * Accessor for all fields defined on the class.
+     * @return The fields
+     */
+    FieldMetadata[] getFields();
+
+    /**
+     * Add a new field to this class.
+     * @param name Name of the field
+     * @return The FieldMetadata
+     */
+    FieldMetadata newFieldMetadata(String name);
+
+    /**
+     * Accessor for the number of fields defined for this class.
+     * @return The number of fields
+     */
+    int getNumberOfFields();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/ClassPersistenceModifier.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/ClassPersistenceModifier.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/ClassPersistenceModifier.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/ClassPersistenceModifier.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+/**
+ * Enumeration of the persistence-modifier values for a class.
+ * @since 2.3
+ */
+public enum ClassPersistenceModifier
+{
+    PERSISTENCE_CAPABLE,
+    PERSISTENCE_AWARE,
+    NON_PERSISTENT
+}

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/CollectionMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/CollectionMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/CollectionMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/CollectionMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+/**
+ * Represents details of a collection in a field/property in a class.
+ * @since 2.3
+ */
+public interface CollectionMetadata extends Metadata {
+    /**
+     * Method to set the name of the element type
+     * 
+     * @param type Name of the element type
+     */
+    void setElementType(String type);
+
+    /**
+     * Accessor for the element type
+     * 
+     * @return The element type
+     */
+    String getElementType();
+
+    /**
+     * Method to set whether the element is embedded
+     * 
+     * @param val Whether it is embedded
+     */
+    void setEmbeddedElement(boolean val);
+
+    /**
+     * Accessor for whether the element is embedded
+     * 
+     * @return whether the element is embedded
+     */
+    Boolean getEmbeddedElement();
+
+    /**
+     * Method to set whether the element is serialised
+     * 
+     * @param val Whether it is serialised
+     */
+    void setSerializedElement(boolean val);
+
+    /**
+     * Accessor for whether the element is serialised
+     * 
+     * @return whether the element is serialised
+     */
+    Boolean getSerializedElement();
+
+    /**
+     * Method to set whether the element is dependent
+     * 
+     * @param val Whether it is dependent
+     */
+    void setDependentElement(boolean val);
+
+    /**
+     * Accessor for whether the element is dependent
+     * 
+     * @return whether the element is dependent
+     */
+    Boolean getDependentElement();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/ColumnMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/ColumnMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/ColumnMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/ColumnMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,163 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+/**
+ * Represents an element in a collection/array.
+ * @since 2.3
+ */
+public interface ColumnMetadata extends Metadata {
+    /**
+     * Method to set the column name.
+     * 
+     * @param name Column name
+     */
+    void setName(String name);
+
+    /**
+     * Accessor for the name of the column.
+     * 
+     * @return The name
+     */
+    String getName();
+
+    /**
+     * Method to set the target column (at the other side of the relation).
+     * 
+     * @param target Target column
+     */
+    void setTarget(String target);
+
+    /**
+     * Accessor for the name of the target column.
+     * 
+     * @return Target column name
+     */
+    String getTarget();
+
+    /**
+     * Method to set the target field (at the other side of the relation).
+     * 
+     * @param target Target field
+     */
+    void setTargetField(String target);
+
+    /**
+     * Accessor for the name of the target field.
+     * 
+     * @return Target field name
+     */
+    String getTargetField();
+
+    /**
+     * Method to set the JDBC type.
+     * 
+     * @param type JDBC Type
+     */
+    void setJDBCType(String type);
+
+    /**
+     * Accessor for the JDBC Type
+     * 
+     * @return JDBC Type
+     */
+    String getJDBCType();
+
+    /**
+     * Method to set the SQL type.
+     * 
+     * @param type SQL Type
+     */
+    void setSQLType(String type);
+
+    /**
+     * Accessor for the SQL Type
+     * 
+     * @return SQL Type
+     */
+    String getSQLType();
+
+    /**
+     * Method to set the length
+     * 
+     * @param len Length
+     */
+    void setLength(int len);
+
+    /**
+     * Accessor for the length
+     * 
+     * @return length
+     */
+    Integer getLength();
+
+    /**
+     * Method to set the scale
+     * 
+     * @param scale scale
+     */
+    void setScale(int scale);
+
+    /**
+     * Accessor for the scale
+     * 
+     * @return scale
+     */
+    Integer getScale();
+
+    /**
+     * Method to set whether it allows null.
+     * 
+     * @param nulls Allows null?
+     */
+    void setAllowsNull(boolean nulls);
+
+    /**
+     * Accessor for whether the column allows null.
+     * 
+     * @return Allows null?
+     */
+    Boolean getAllowsNull();
+
+    /**
+     * Method to set the default value.
+     * 
+     * @param val Default value
+     */
+    void setDefaultValue(String val);
+
+    /**
+     * Accessor for the default value
+     * 
+     * @return Default value
+     */
+    String getDefaultValue();
+
+    /**
+     * Method to set the insert value (for columns with no field/property).
+     * 
+     * @param val Insert value
+     */
+    void setInsertValue(String val);
+
+    /**
+     * Accessor for the insert value (for columns with no field/property)
+     * 
+     * @return Insert value
+     */
+    String getInsertValue();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/ComponentMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/ComponentMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/ComponentMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/ComponentMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,365 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+import javax.jdo.annotations.IdentityType;
+
+/**
+ * Represents a class or interface. Extended for the specifics of those cases.
+ * @since 2.3
+ */
+public interface ComponentMetadata extends Metadata {
+    /**
+     * Accessor for the name of this component (set on construction).
+     * 
+     * @return The name
+     */
+    String getName();
+
+    /**
+     * Method to define the identity type to use.
+     * 
+     * @param id identity type
+     */
+    void setIdentityType(IdentityType id);
+
+    /**
+     * Accessor for the identity type to use.
+     * 
+     * @return identity type
+     */
+    IdentityType getIdentityType();
+
+    /**
+     * Method to set the object-id (PK) class.
+     * 
+     * @param idclass Object-id class
+     */
+    void setObjectIdClass(String idclass);
+
+    /**
+     * Accessor for the object-id class (if defined).
+     * 
+     * @return The object-id class
+     */
+    String getObjectIdClass();
+
+    /**
+     * Method to set whether the component requires an extent.
+     * 
+     * @param extent Requires extent?
+     */
+    void setRequiresExtent(boolean extent);
+
+    /**
+     * Accessor for whether the component requires an extent.
+     * 
+     * @return Requires extent?
+     */
+    boolean getRequiresExtent();
+
+    /**
+     * Method to set whether this is detachable
+     * 
+     * @param detachable Detachable?
+     */
+    void setDetachable(boolean detachable);
+
+    /**
+     * Accessor for whether this is detachable.
+     * 
+     * @return Detachable?
+     */
+    boolean getDetachable();
+
+    /**
+     * Method to set whether this is cacheable
+     * 
+     * @param cacheable Cacheable?
+     */
+    void setCacheable(boolean cacheable);
+
+    /**
+     * Accessor for whether this is cacheable.
+     * 
+     * @return Detachable?
+     */
+    boolean getCacheable();
+
+    /**
+     * Method to set whether it is stored only as embedded in other objects.
+     * 
+     * @param embedded Whether it is only stored embedded
+     */
+    void setEmbeddedOnly(boolean extent);
+
+    /**
+     * Accessor for whether this is embedded only.
+     * 
+     * @return Only stored as embedded
+     */
+    Boolean getEmbeddedOnly();
+
+    /**
+     * Method to set the catalog (ORM) for this component
+     * 
+     * @param catalog Catalog name
+     */
+    void setCatalog(String catalog);
+
+    /**
+     * Accessor for the catalog (ORM) for this component
+     * 
+     * @return The catalog
+     */
+    String getCatalog();
+
+    /**
+     * Method to set the schema (ORM) for this component
+     * 
+     * @param schema Schema name
+     */
+    void setSchema(String schema);
+
+    /**
+     * Accessor for the schema (ORM) for this component
+     * 
+     * @return The schema
+     */
+    String getSchema();
+
+    /**
+     * Method to set the table name.
+     * 
+     * @param table Table name
+     */
+    void setTable(String table);
+
+    /**
+     * Accessor for the name of the table.
+     * 
+     * @return The name
+     */
+    String getTable();
+
+    /**
+     * Method to define the inheritance metadata.
+     * 
+     * @return The InheritanceMetadata
+     */
+    InheritanceMetadata newInheritanceMetadata();
+
+    /**
+     * Accessor for the inheritance (if any).
+     * 
+     * @return inheritance
+     */
+    InheritanceMetadata getInheritanceMetadata();
+
+    /**
+     * Method to define the version metadata.
+     * 
+     * @return The VersionMetadata
+     */
+    VersionMetadata newVersionMetadata();
+
+    /**
+     * Accessor for the version (if any).
+     * 
+     * @return version
+     */
+    VersionMetadata getVersionMetadata();
+
+    /**
+     * Method to define the datastore identity metadata details.
+     * 
+     * @return The DatastoreIdentityMetadata
+     */
+    DatastoreIdentityMetadata newDatastoreIdentityMetadata();
+
+    /**
+     * Accessor for the datastore identity details.
+     * 
+     * @return datastore identity details
+     */
+    DatastoreIdentityMetadata getDatastoreIdentityMetadata();
+
+    /**
+     * Method to define the primary key details.
+     * 
+     * @return The PrimaryKeyMetadata
+     */
+    PrimaryKeyMetadata newPrimaryKeyMetadata();
+
+    /**
+     * Accessor for the primary key (if any).
+     * 
+     * @return primary key details
+     */
+    PrimaryKeyMetadata getPrimaryKeyMetadata();
+
+    /**
+     * Accessor for all joins(s) defined on the component.
+     * 
+     * @return The join(s)
+     */
+    JoinMetadata[] getJoins();
+
+    /**
+     * Add a join for this component.
+     * 
+     * @return The JoinMetadata
+     */
+    JoinMetadata newJoinMetadata();
+
+    /**
+     * Accessor for the number of join(s) defined for this component.
+     * 
+     * @return The number of join(s)
+     */
+    int getNumberOfJoins();
+
+    /**
+     * Accessor for all fk(s) defined on the component.
+     * 
+     * @return The fk(s)
+     */
+    ForeignKeyMetadata[] getForeignKeys();
+
+    /**
+     * Add a new FK for this component.
+     * 
+     * @return The ForeignKeyMetadata
+     */
+    ForeignKeyMetadata newForeignKeyMetadata();
+
+    /**
+     * Accessor for the number of FKs defined for this component.
+     * 
+     * @return The number of FKs
+     */
+    int getNumberOfForeignKeys();
+
+    /**
+     * Accessor for all index(s) defined on the component.
+     * 
+     * @return The index(s)
+     */
+    IndexMetadata[] getIndices();
+
+    /**
+     * Add a new index for this component.
+     * 
+     * @return The IndexMetadata
+     */
+    IndexMetadata newIndexMetadata();
+
+    /**
+     * Accessor for the number of indices defined for this component.
+     * 
+     * @return The number of indices
+     */
+    int getNumberOfIndices();
+
+    /**
+     * Accessor for all unique constraints defined on the component.
+     * 
+     * @return The unique constraints
+     */
+    UniqueMetadata[] getUniques();
+
+    /**
+     * Add a new unique constraint for this component.
+     * 
+     * @return The UniqueMetadata
+     */
+    UniqueMetadata newUniqueMetadata();
+
+    /**
+     * Accessor for the number of unique constraints defined for this component.
+     * 
+     * @return The number of unique constraints
+     */
+    int getNumberOfUniques();
+
+    /**
+     * Accessor for all properties defined on the component.
+     * 
+     * @return The properties
+     */
+    PropertyMetadata[] getProperties();
+
+    /**
+     * Add a new property for this component.
+     * 
+     * @param name Name of the property
+     * @return The PropertyMetadata
+     */
+    PropertyMetadata newPropertyMetadata(String name);
+
+    /**
+     * Accessor for the number of properties defined for this component.
+     * 
+     * @return The number of properties
+     */
+    int getNumberOfProperties();
+
+    /**
+     * Accessor for all named queries defined on the component.
+     * 
+     * @return The queries
+     */
+    QueryMetadata[] getQueries();
+
+    /**
+     * Add a new query for this component.
+     * 
+     * @param name
+     *            Name of the query to add
+     * @return The QueryMetadata
+     */
+    QueryMetadata newQueryMetadata(String name);
+
+    /**
+     * Accessor for the number of named queries defined for this component.
+     * 
+     * @return The number of named queries
+     */
+    int getNumberOfQueries();
+
+    /**
+     * Accessor for all FetchGroup defined on the component.
+     * 
+     * @return The FetchGroups
+     */
+    FetchGroupMetadata[] getFetchGroups();
+
+    /**
+     * Add a new FetchGroup for this component.
+     * 
+     * @param name Name of the FetchGroup
+     * @return The FetchGroupMetadata
+     */
+    FetchGroupMetadata newFetchGroupMetadata(String name);
+
+    /**
+     * Accessor for the number of fetchGroups defined for this component.
+     * 
+     * @return The number of fetch groups
+     */
+    int getNumberOfFetchGroups();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/DatastoreIdentityMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/DatastoreIdentityMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/DatastoreIdentityMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/DatastoreIdentityMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+import javax.jdo.annotations.VersionStrategy;
+
+/**
+ * Represents the datastore identity of a class.
+ * @since 2.3
+ */
+public interface DatastoreIdentityMetadata extends Metadata {
+    /**
+     * Method to set the datastore identity column name.
+     * 
+     * @param column Name of the datastore identity column
+     */
+    void setColumn(String column);
+
+    /**
+     * Accessor for the datastore identity column name
+     * 
+     * @return The column name
+     */
+    String getColumn();
+
+    /**
+     * Method to set the identity generation strategy.
+     * 
+     * @param strategy The strategy
+     */
+    void setStrategy(VersionStrategy strategy);
+
+    /**
+     * Accessor for the identity generation strategy.
+     * 
+     * @return The strategy
+     */
+    VersionStrategy getStrategy();
+
+    /**
+     * Method to set the custom identity generation strategy.
+     * 
+     * @param strategy The strategy
+     */
+    void setCustomStrategy(String strategy);
+
+    /**
+     * Accessor for the custom strategy (overriding "strategy").
+     * 
+     * @return The strategy
+     */
+    String getCustomStrategy();
+
+    /**
+     * Method to set the sequence key (when using "sequence" strategy)
+     * 
+     * @param seq Sequence key
+     */
+    void setSequence(String seq);
+
+    /**
+     * Accessor for the sequence key (when using "sequence" strategy)
+     * 
+     * @return The sequence
+     */
+    String getSequence();
+
+    /**
+     * Accessor for all column(s) defined on the datastore identity.
+     * 
+     * @return The column(s)
+     */
+    ColumnMetadata[] getColumns();
+
+    /**
+     * Add a new column for this datastore identity.
+     * 
+     * @return The ColumnMetadata
+     */
+    ColumnMetadata newColumnMetadata();
+
+    /**
+     * Accessor for the number of columns defined for this datastore identity.
+     * 
+     * @return The number of columns
+     */
+    int getNumberOfColumns();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/DiscriminatorMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/DiscriminatorMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/DiscriminatorMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/DiscriminatorMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+import javax.jdo.annotations.DiscriminatorStrategy;
+
+/**
+ * Represents the discriminator for inheritance purposes for this class.
+ * @since 2.3
+ */
+public interface DiscriminatorMetadata extends Metadata {
+    /**
+     * Method to set the discriminator column.
+     * 
+     * @param column Name of the discriminator clumn
+     */
+    void setColumn(String column);
+
+    /**
+     * Accessor for the discriminator column name
+     * 
+     * @return The column name
+     */
+    String getColumn();
+
+    /**
+     * Method to set the discriminator value (when using "value-map" strategy).
+     * 
+     * @param val Value for the discriminator for this class
+     */
+    void setValue(String val);
+
+    /**
+     * Accessor for the discriminator value (when using "value-map" strategy).
+     * 
+     * @return The value
+     */
+    String getValue();
+
+    /**
+     * Method to set the discriminator strategy.
+     * 
+     * @param strategy The strategy
+     */
+    void setStrategy(DiscriminatorStrategy strategy);
+
+    /**
+     * Accessor for the discriminator strategy.
+     * 
+     * @return The strategy
+     */
+    DiscriminatorStrategy getStrategy();
+
+    /**
+     * Method to set whether indexed.
+     * 
+     * @param indexed Whether indexed (true | false | unique)
+     */
+    void setIndexed(Indexed indexed);
+
+    /**
+     * Accessor for whether indexed (true|false|unique)
+     * 
+     * @return Indexed?
+     */
+    Indexed getIndexed();
+
+    /**
+     * Accessor for all column(s) defined on the discriminator.
+     * 
+     * @return The column(s)
+     */
+    ColumnMetadata[] getColumns();
+
+    /**
+     * Add a new column for this discriminator.
+     * 
+     * @return The ColumnMetadata
+     */
+    ColumnMetadata newColumnMetadata();
+
+    /**
+     * Accessor for the number of columns defined for this discriminator.
+     * 
+     * @return The number of columns
+     */
+    int getNumberOfColumns();
+
+    /**
+     * Method to set the index metadata for the discriminator
+     * 
+     * @return The IndexMetadata
+     */
+    IndexMetadata newtIndexMetadata();
+
+    /**
+     * Accessor for any index metadata for the discriminator
+     * 
+     * @return Index metadata
+     */
+    IndexMetadata getIndexMetadata();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/ElementMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/ElementMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/ElementMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/ElementMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,158 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+import javax.jdo.annotations.ForeignKeyAction;
+
+/**
+ * Represents an element in a collection/array.
+ * @since 2.3
+ */
+public interface ElementMetadata extends Metadata {
+    /**
+     * Method to set the column name.
+     * 
+     * @param column Column name
+     */
+    void setColumn(String column);
+
+    /**
+     * Accessor for the name of the column.
+     * 
+     * @return The name
+     */
+    String getColumn();
+
+    /**
+     * Method to set the table name.
+     * 
+     * @param table Table name
+     */
+    void setTable(String table);
+
+    /**
+     * Accessor for the name of the table.
+     * 
+     * @return The name
+     */
+    String getTable();
+
+    /**
+     * Method to set the delete action of the FK
+     * 
+     * @param action Delete action of the FK
+     */
+    void setDeleteAction(ForeignKeyAction action);
+
+    /**
+     * Accessor for the delete action of the FK
+     * 
+     * @return The FK delete-action
+     */
+    ForeignKeyAction getDeleteAction();
+
+    /**
+     * Method to set the update action of the FK
+     * 
+     * @param action Update action of the FK
+     */
+    void setUpdateAction(ForeignKeyAction action);
+
+    /**
+     * Accessor for the update action of the FK
+     * 
+     * @return The FK update-action
+     */
+    ForeignKeyAction getUpdateAction();
+
+    /**
+     * Accessor for all column(s) defined on the element.
+     * 
+     * @return The column(s)
+     */
+    ColumnMetadata[] getColumns();
+
+    /**
+     * Add a new column for this element.
+     * 
+     * @return The ColumnMetadata
+     */
+    ColumnMetadata newColumn();
+
+    /**
+     * Accessor for the number of columns defined for this element.
+     * 
+     * @return The number of columns
+     */
+    int getNumberOfColumns();
+
+    /**
+     * Method to set new embedded metadata for the element.
+     * 
+     * @return The EmbeddedMetadata
+     */
+    EmbeddedMetadata newEmbeddedMetadata();
+
+    /**
+     * Accessor for any embedded metadata on this element
+     * 
+     * @return The EmbeddedMetadata
+     */
+    EmbeddedMetadata getEmbeddedMetadata();
+
+    /**
+     * Method to set new index metadata for the element.
+     * 
+     * @return The IndexMetadata
+     */
+    IndexMetadata newIndexMetadata();
+
+    /**
+     * Accessor for any index metadata on this element
+     * 
+     * @return Index metadata
+     */
+    IndexMetadata getIndexMetadata();
+
+    /**
+     * Method to set new unique constraint metadata for the element
+     * 
+     * @return The UniqueMetadata
+     */
+    UniqueMetadata newUniqueMetadata();
+
+    /**
+     * Accessor for any unique constraint metadata on this element.
+     * 
+     * @return The UniqueMetadata
+     */
+    UniqueMetadata getUniqueMetadata();
+
+    /**
+     * Method to set new foreign key metadata for the element
+     * 
+     * @return The ForeignKeyMetadata
+     */
+    ForeignKeyMetadata newForeignKeyMetadata();
+
+    /**
+     * Accessor for any foreign key metadata on this element.
+     * 
+     * @return The ForeignKeyMetadata
+     */
+    ForeignKeyMetadata getForeignKeyMetadata();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/EmbeddedMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/EmbeddedMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/EmbeddedMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/EmbeddedMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+/**
+ * Represents embedding details of a field/property in a class.
+ * @since 2.3
+ */
+public interface EmbeddedMetadata extends Metadata {
+    /**
+     * Method to set the name of the owner field.
+     * 
+     * @param fld Name of the owner field
+     */
+    void setOwnerField(String fld);
+
+    /**
+     * Accessor for the owner field name.
+     * 
+     * @return The owner field name
+     */
+    String getOwnerField();
+
+    /**
+     * Method to set any column that indicates a null embedded object
+     * 
+     * @param col Null indicator column
+     */
+    void setNullIndicatorColumn(String col);
+
+    /**
+     * Accessor for any column indicating a null embedded object
+     * 
+     * @return Whether to call post-load
+     */
+    String getNullIndicatorColumn();
+
+    /**
+     * Method to set the value of a null indicator column to signify null object
+     * 
+     * @param val Null indicator value
+     */
+    void setNullIndicatorValue(String val);
+
+    /**
+     * Accessor for a null indicator value
+     * 
+     * @return Null indicator value
+     */
+    String getNullIndicatorValue();
+
+    /**
+     * Accessor for all fields defined on the fetch group.
+     * 
+     * @return The fields
+     */
+    FieldMetadata[] getFields();
+
+    /**
+     * Add a new field to be embedded
+     * 
+     * @param name Name of the field
+     * @return The FieldMetadata
+     */
+    FieldMetadata newFieldMetadata(String name);
+
+    /**
+     * Accessor for the number of fields defined for embedding
+     * 
+     * @return The number of fields
+     */
+    int getNumberOfFields();
+
+    /**
+     * Accessor for all properties defined for embedding
+     * 
+     * @return The properties
+     */
+    PropertyMetadata[] getProperties();
+
+    /**
+     * Add a new property for embedding
+     * 
+     * @param name Name of the property
+     * @return The PropertyMetadata
+     */
+    PropertyMetadata newPropertyMetadata(String name);
+
+    /**
+     * Accessor for the number of properties defined for embedding
+     * 
+     * @return The number of properties
+     */
+    int getNumberOfProperties();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/ExtensionMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/ExtensionMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/ExtensionMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/ExtensionMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+/**
+ * A vendor extension defined in Metadata.
+ *
+ * @version 2.3
+ */
+public interface ExtensionMetadata {
+    /**
+     * Accessor for the vendor name (set at construction).
+     * @return The vendor
+     */
+    String getVendorName();
+
+    /**
+     * Accessor for the key (set at construction).
+     * @return The key
+     */
+    String getKey();
+
+    /**
+     * Accessor for the value (set at construction).
+     * @return The value
+     */
+    String getValue();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/FetchGroupMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/FetchGroupMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/FetchGroupMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/FetchGroupMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+/**
+ * Represents a fetch group for a class.
+ * @since 2.3
+ */
+public interface FetchGroupMetadata extends Metadata {
+    /**
+     * Accessor for the fetch group name (set on construction).
+     * 
+     * @return The fetch group name
+     */
+    String getName();
+
+    /**
+     * Method to set whether to call post load with this fetch group
+     * 
+     * @param load Call post load
+     */
+    void setPostLoad(boolean load);
+
+    /**
+     * Accessor for whether to call post load for this fetch group
+     * 
+     * @return Whether to call post-load
+     */
+    boolean getPostLoad();
+
+    /**
+     * Accessor for all fields defined on the fetch group.
+     * 
+     * @return The fields
+     */
+    FieldMetadata[] getFields();
+
+    /**
+     * Add a new field for this fetch group.
+     * 
+     * @param name Name of field
+     * @return The FieldMetadata
+     */
+    FieldMetadata newFieldMetadata(String name);
+
+    /**
+     * Accessor for the number of fields defined for this fetch group.
+     * 
+     * @return The number of fields
+     */
+    int getNumberOfFields();
+
+    /**
+     * Accessor for all properties defined on the fetch group.
+     * 
+     * @return The properties
+     */
+    PropertyMetadata[] getProperties();
+
+    /**
+     * Add a new property for this fetch group
+     * 
+     * @param name Name of property
+     * @return The PropertyMetadata
+     */
+    PropertyMetadata newPropertyMetadata(String name);
+
+    /**
+     * Accessor for the number of properties defined for this fetch group
+     * 
+     * @return The number of properties
+     */
+    int getNumberOfProperties();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/FetchPlanMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/FetchPlanMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/FetchPlanMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/FetchPlanMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+/**
+ * Represents a fetch plan for a class.
+ * @since 2.3
+ */
+public interface FetchPlanMetadata extends Metadata {
+    /**
+     * Accessor for the fetch plan name (set on construction).
+     * 
+     * @return The fetch plan name
+     */
+    String getName();
+
+    /**
+     * Method to set the max fetch depth for this plan.
+     * 
+     * @param depth The max fetch depth
+     */
+    void setMaxFetchDepth(int depth);
+
+    /**
+     * Accessor for the max fetch depth.
+     * 
+     * @return The max fetch depth
+     */
+    int getMaxFetchDepth();
+
+    /**
+     * Method to set the fetch size.
+     * 
+     * @param size The fetch size
+     */
+    void setFetchSize(int size);
+
+    /**
+     * Accessor for the max fetch depth.
+     * 
+     * @return The max fetch depth
+     */
+    int getFetchSize();
+
+    /**
+     * Accessor for all fetch groups defined for this fetch plan.
+     * 
+     * @return The fetch groups
+     */
+    FetchGroupMetadata[] getFetchGroups();
+
+    /**
+     * Add a new fetch group for this fetch plan.
+     * 
+     * @param name Name of fetch group.
+     * @return The FetchGroupMetadata
+     */
+    FetchGroupMetadata newFetchGroupMetadata(String name);
+
+    /**
+     * Accessor for the number of fetch groups defined for this fetch plan.
+     * 
+     * @return The number of fetch groups
+     */
+    int getNumberOfFetchGroups();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/FieldMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/FieldMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/FieldMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/FieldMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+/**
+ * Represents a field in a class.
+ * @since 2.3
+ */
+public interface FieldMetadata extends MemberMetadata {
+
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/ForeignKeyMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/ForeignKeyMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/ForeignKeyMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/ForeignKeyMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,174 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+import javax.jdo.annotations.ForeignKeyAction;
+
+/**
+ * Represents a FK constraint in an ORM context.
+ * @since 2.3
+ */
+public interface ForeignKeyMetadata extends Metadata {
+    /**
+     * Method to set the name of the constraint
+     * 
+     * @param name Name of the constraint
+     */
+    void setName(String name);
+
+    /**
+     * Accessor for the constraint name.
+     * 
+     * @return The constraint name
+     */
+    String getName();
+
+    /**
+     * Method to set the table name.
+     * 
+     * @param table Table name
+     */
+    void setTable(String table);
+
+    /**
+     * Accessor for the name of the table.
+     * 
+     * @return The name
+     */
+    String getTable();
+
+    /**
+     * Method to set whether it is unique.
+     * 
+     * @param unique Unique?
+     */
+    void setUnique(boolean unique);
+
+    /**
+     * Accessor for whether unique.
+     * 
+     * @return Unique?
+     */
+    Boolean getUnique();
+
+    /**
+     * Method to set whether it is deferred.
+     * 
+     * @param def Deferred?
+     */
+    void setDeferred(boolean def);
+
+    /**
+     * Accessor for whether the constraint can be deferred.
+     * 
+     * @return Deferred?
+     */
+    Boolean getDeferred();
+
+    /**
+     * Method to set the delete action of the FK
+     * 
+     * @param action Delete action of the FK
+     */
+    void setDeleteAction(ForeignKeyAction action);
+
+    /**
+     * Accessor for the delete action of the FK
+     * 
+     * @return The FK delete-action
+     */
+    ForeignKeyAction getDeleteAction();
+
+    /**
+     * Method to set the update action of the FK
+     * 
+     * @param action Update action of the FK
+     */
+    void setUpdateAction(ForeignKeyAction action);
+
+    /**
+     * Accessor for the update action of the FK
+     * 
+     * @return The FK update-action
+     */
+    ForeignKeyAction getUpdateAction();
+
+    /**
+     * Accessor for all column(s) defined on the FK.
+     * 
+     * @return The column(s)
+     */
+    ColumnMetadata[] getColumns();
+
+    /**
+     * Add a new column for this FK.
+     * 
+     * @return The ColumnMetadata
+     */
+    ColumnMetadata newColumnMetadata();
+
+    /**
+     * Accessor for the number of columns defined for this FK.
+     * 
+     * @return The number of columns
+     */
+    int getNumberOfColumns();
+
+    /**
+     * Accessor for all field(s) defined on the FK.
+     * 
+     * @return The field(s)
+     */
+    FieldMetadata[] getFields();
+
+    /**
+     * Add a new field for this FK.
+     * 
+     * @param name Name of the field
+     * @return The FieldMetadata
+     */
+    FieldMetadata newFieldMetadata(String name);
+
+    /**
+     * Accessor for the number of fields defined for this FK.
+     * 
+     * @return The number of fields
+     */
+    int getNumberOfFields();
+
+    /**
+     * Accessor for all properties defined on the FK.
+     * 
+     * @return The properties
+     */
+    PropertyMetadata[] getProperties();
+
+    /**
+     * Add a new property for this FK.
+     * 
+     * @param name Name of the property
+     * @return The PropertyMetadata
+     */
+    PropertyMetadata newPropertyMetadata(String name);
+
+    /**
+     * Accessor for the number of properties defined for this FK.
+     * 
+     * @return The number of properties
+     */
+    int getNumberOfProperties();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/IndexMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/IndexMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/IndexMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/IndexMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+/**
+ * Represents an index.
+ * @since 2.3
+ */
+public interface IndexMetadata extends Metadata {
+    /**
+     * Method to set the name of the index
+     * 
+     * @param name Name of the index
+     */
+    void setName(String name);
+
+    /**
+     * Accessor for the index name.
+     * 
+     * @return The index name
+     */
+    String getName();
+
+    /**
+     * Method to set the table name.
+     * 
+     * @param table Table name
+     */
+    void setTable(String table);
+
+    /**
+     * Accessor for the name of the table.
+     * 
+     * @return The name
+     */
+    String getTable();
+
+    /**
+     * Method to set whether it is unique.
+     * 
+     * @param unique Unique?
+     */
+    void setUnique(boolean unique);
+
+    /**
+     * Accessor for whether unique.
+     * 
+     * @return Unique?
+     */
+    Boolean getUnique();
+
+    /**
+     * Accessor for all column(s) defined on the index.
+     * 
+     * @return The column(s)
+     */
+    ColumnMetadata[] getColumns();
+
+    /**
+     * Add a new column for this index.
+     * 
+     * @return The ColumnMetadata
+     */
+    ColumnMetadata newColumn();
+
+    /**
+     * Accessor for the number of columns defined for this index.
+     * 
+     * @return The number of columns
+     */
+    int getNumberOfColumns();
+
+    /**
+     * Accessor for all field(s) defined on the index.
+     * 
+     * @return The field(s)
+     */
+    FieldMetadata[] getFields();
+
+    /**
+     * Add a new field for this index.
+     * 
+     * @param name Name of the field
+     * @return The FieldMetadata
+     */
+    FieldMetadata newFieldMetadata(String name);
+
+    /**
+     * Accessor for the number of fields defined for this index.
+     * 
+     * @return The number of fields
+     */
+    int getNumberOfFields();
+
+    /**
+     * Accessor for all properties defined on the index.
+     * 
+     * @return The properties
+     */
+    PropertyMetadata[] getProperties();
+
+    /**
+     * Add a new property for this index.
+     * 
+     * @param name Name of the property
+     * @return The PropertyMetadata
+     */
+    PropertyMetadata newPropertyMetadata(String name);
+
+    /**
+     * Accessor for the number of properties defined for this index.
+     * 
+     * @return The number of properties
+     */
+    int getNumberOfProperties();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/Indexed.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/Indexed.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/Indexed.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/Indexed.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+/**
+ * Enumeration of the indexed values.
+ * 
+ * @version 2.3
+ * @since 2.3
+ */
+public enum Indexed
+{
+    UNSPECIFIED,
+    TRUE,
+    FALSE,
+    UNIQUE
+}

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/InheritanceMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/InheritanceMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/InheritanceMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/InheritanceMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+import javax.jdo.annotations.InheritanceStrategy;
+
+/**
+ * Represents the inheritance of a class.
+ * @since 2.3
+ */
+public interface InheritanceMetadata extends Metadata {
+    /**
+     * Method to set the inheritance strategy.
+     * 
+     * @param strategy The strategy
+     */
+    void setStrategy(InheritanceStrategy strategy);
+
+    /**
+     * Accessor for the inheritance strategy.
+     * 
+     * @return The strategy
+     */
+    InheritanceStrategy getStrategy();
+
+    /**
+     * Method to set the custom inheritance strategy.
+     * 
+     * @param strategy The strategy
+     */
+    void setCustomStrategy(String strategy);
+
+    /**
+     * Accessor for the custom inheritance (overriding "strategy").
+     * 
+     * @return The strategy
+     */
+    String getCustomStrategy();
+
+    /**
+     * Method to define the new discriminator metadata.
+     * 
+     * @return The DiscriminatorMetadata
+     */
+    DiscriminatorMetadata newDiscriminatorMetadata();
+
+    /**
+     * Accessor for the discriminator (if any).
+     * 
+     * @return Discriminator
+     */
+    DiscriminatorMetadata getDiscriminatorMetaData();
+
+    /**
+     * Method to define the new join information
+     * 
+     * @return The JoinMetadata
+     */
+    JoinMetadata newJoinMetadata();
+
+    /**
+     * Accessor for the join (if any).
+     * 
+     * @return Join information
+     */
+    JoinMetadata getJoinMetaData();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/InterfaceMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/InterfaceMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/InterfaceMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/InterfaceMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+/**
+ * Represents a persistent-interface.
+ * @since 2.3
+ */
+public interface InterfaceMetadata extends ComponentMetadata {
+    
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/JDOMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/JDOMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/JDOMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/JDOMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+/**
+ * Represents the top-level JDO metadata.
+ * @since 2.3
+ */
+public interface JDOMetadata extends Metadata {
+    /**
+     * Method to set the catalog (ORM) to apply to all classes in this JDO Metadata.
+     * 
+     * @param catalog Catalog name
+     */
+    void setCatalog(String catalog);
+
+    /**
+     * Accessor for the catalog (ORM) that all classes in this JDO Metadata
+     * default to.
+     * 
+     * @return The catalog
+     */
+    String getCatalog();
+
+    /**
+     * Method to set the schema (ORM) to apply to all classes in this JDO
+     * Metadata.
+     * 
+     * @param schema Schema name
+     */
+    void setSchema(String schema);
+
+    /**
+     * Accessor for the schema (ORM) that all classes in this JDO Metadata
+     * default to.
+     * 
+     * @return The schema
+     */
+    String getSchema();
+
+    /**
+     * Accessor for all packages defined on the JDO Metadata.
+     * 
+     * @return The packages
+     */
+    PackageMetadata[] getPackages();
+
+    /**
+     * Add a new package to this JDO Metadata.
+     * 
+     * @param pkgName Name of the package
+     * @return The PackageMetadata
+     */
+    PackageMetadata newPackageMetadata(String pkgName);
+
+    /**
+     * Accessor for the number of packages defined in this JDO Metadata.
+     * 
+     * @return The number of packages.
+     */
+    int getNumberOfPackages();
+
+    /**
+     * Accessor for any named queries defined on the JDO Metadata.
+     * 
+     * @return The queries
+     */
+    QueryMetadata[] getQueries();
+
+    /**
+     * Add a new named query to this JDO Metadata.
+     * 
+     * @param name Name of the query
+     * @return The QueryMetadata
+     */
+    QueryMetadata newQueryMetadata(String name);
+
+    /**
+     * Accessor for the number of named queries defined in this JDO Metadata.
+     * 
+     * @return The number of queries.
+     */
+    int getNumberOfQueries();
+
+    /**
+     * Accessor for any fetch plans defined on the JDO Metadata.
+     * 
+     * @return The fetch plans
+     */
+    FetchPlanMetadata[] getFetchPlans();
+
+    /**
+     * Add a new fetch plan to this JDO Metadata.
+     * 
+     * @param name Name of the query
+     * @return The FetchPlanMetadata
+     */
+    FetchPlanMetadata newFetchPlanMetadata(String name);
+
+    /**
+     * Accessor for the number of fetch plans defined in this JDO Metadata.
+     * 
+     * @return The number of fetch plans.
+     */
+    int getNumberOfFetchPlans();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/JoinMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/JoinMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/JoinMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/JoinMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,186 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+import javax.jdo.annotations.ForeignKeyAction;
+
+/**
+ * Represents join information.
+ * @since 2.3
+ */
+public interface JoinMetadata extends Metadata {
+    /**
+     * Method to set the join column.
+     * 
+     * @param column Name of the join column
+     */
+    void setColumn(String column);
+
+    /**
+     * Accessor for the join column name
+     * 
+     * @return The column name
+     */
+    String getColumn();
+
+    /**
+     * Method to set the table name.
+     * 
+     * @param table Table name
+     */
+    void setTable(String table);
+
+    /**
+     * Accessor for the name of the table.
+     * 
+     * @return The name
+     */
+    String getTable();
+
+    /**
+     * Method to set whether to use an outer join
+     * 
+     * @param outer Outer join?
+     */
+    void setOuter(boolean outer);
+
+    /**
+     * Accessor for whether to use an outer join.
+     * 
+     * @return Outer join?
+     */
+    boolean getOuter();
+
+    /**
+     * Method to set the delete action of the FK
+     * 
+     * @param action Delete action of the FK
+     */
+    void setDeleteAction(ForeignKeyAction action);
+
+    /**
+     * Accessor for the delete action of the FK
+     * 
+     * @return The FK delete-action
+     */
+    ForeignKeyAction getDeleteAction();
+
+    /**
+     * Method to set whether indexed.
+     * 
+     * @param indexed Whether indexed (true | false | unique)
+     */
+    void setIndexed(Indexed indexed);
+
+    /**
+     * Accessor for whether indexed (true|false|unique)
+     * 
+     * @return Indexed?
+     */
+    Indexed getIndexed();
+
+    /**
+     * Method to set whether it is unique.
+     * 
+     * @param unique Unique?
+     */
+    void setUnique(boolean unique);
+
+    /**
+     * Accessor for whether unique.
+     * 
+     * @return Unique?
+     */
+    Boolean getUnique();
+
+    /**
+     * Method to set new index metadata for the join.
+     * 
+     * @return The IndexMetadata
+     */
+    IndexMetadata newIndexMetadata();
+
+    /**
+     * Accessor for any index metadata on this join
+     * 
+     * @return Index metadata
+     */
+    IndexMetadata getIndexMetadata();
+
+    /**
+     * Method to set new unique constraint metadata for the join
+     * 
+     * @return The UniqueMetadata
+     */
+    UniqueMetadata newUniqueMetadata();
+
+    /**
+     * Accessor for any unique constraint metadata on this join.
+     * 
+     * @return The UniqueMetadata
+     */
+    UniqueMetadata getUniqueMetadata();
+
+    /**
+     * Method to set new foreign key metadata for the join
+     * 
+     * @return The ForeignKeyMetadata
+     */
+    ForeignKeyMetadata newForeignKeyMetadata();
+
+    /**
+     * Accessor for any foreign key metadata on this join.
+     * 
+     * @return The ForeignKeyMetadata
+     */
+    ForeignKeyMetadata getForeignKeyMetadata();
+
+    /**
+     * Method to set new primary key metadata for the join
+     * 
+     * @return The PrimaryKeyMetadata
+     */
+    PrimaryKeyMetadata newPrimaryKeyMetadata();
+
+    /**
+     * Accessor for any primary key metadata on this join.
+     * 
+     * @return The PrimaryKeyMetadata
+     */
+    PrimaryKeyMetadata getPrimaryKeyMetadata();
+
+    /**
+     * Accessor for all column(s) defined on the join.
+     * 
+     * @return The column(s)
+     */
+    ColumnMetadata[] getColumns();
+
+    /**
+     * Add a new column for this join.
+     * 
+     * @return The ColumnMetadata
+     */
+    ColumnMetadata newColumnMetadata();
+
+    /**
+     * Accessor for the number of columns defined for this join.
+     * 
+     * @return The number of columns
+     */
+    int getNumberOfColumns();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/KeyMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/KeyMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/KeyMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/KeyMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,157 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+import javax.jdo.annotations.ForeignKeyAction;
+
+/**
+ * Represents a key in a map.
+ */
+public interface KeyMetadata extends Metadata {
+    /**
+     * Method to set the column name.
+     * 
+     * @param column Column name
+     */
+    void setColumn(String column);
+
+    /**
+     * Accessor for the name of the column.
+     * 
+     * @return The name
+     */
+    String getColumn();
+
+    /**
+     * Method to set the table name.
+     * 
+     * @param table Table name
+     */
+    void setTable(String table);
+
+    /**
+     * Accessor for the name of the table.
+     * 
+     * @return The name
+     */
+    String getTable();
+
+    /**
+     * Method to set the delete action of the FK
+     * 
+     * @param action Delete action of the FK
+     */
+    void setDeleteAction(ForeignKeyAction action);
+
+    /**
+     * Accessor for the delete action of the FK
+     * 
+     * @return The FK delete-action
+     */
+    ForeignKeyAction getDeleteAction();
+
+    /**
+     * Method to set the update action of the FK
+     * 
+     * @param action Update action of the FK
+     */
+    void setUpdateAction(ForeignKeyAction action);
+
+    /**
+     * Accessor for the update action of the FK
+     * 
+     * @return The FK update-action
+     */
+    ForeignKeyAction getUpdateAction();
+
+    /**
+     * Accessor for all column(s) defined on the key.
+     * 
+     * @return The column(s)
+     */
+    ColumnMetadata[] getColumns();
+
+    /**
+     * Add a new column for this key.
+     * 
+     * @return The ColumnMetadata
+     */
+    ColumnMetadata newColumn();
+
+    /**
+     * Accessor for the number of columns defined for this key.
+     * 
+     * @return The number of columns
+     */
+    int getNumberOfColumns();
+
+    /**
+     * Method to set new embedded metadata for the key.
+     * 
+     * @return The EmbeddedMetadata
+     */
+    EmbeddedMetadata newEmbeddedMetadata();
+
+    /**
+     * Accessor for any embedded metadata on this key
+     * 
+     * @return The EmbeddedMetadata
+     */
+    EmbeddedMetadata getEmbeddedMetadata();
+
+    /**
+     * Method to set new index metadata for the key.
+     * 
+     * @return The IndexMetadata
+     */
+    IndexMetadata newIndexMetadata();
+
+    /**
+     * Accessor for any index metadata on this key
+     * 
+     * @return Index metadata
+     */
+    IndexMetadata getIndexMetadata();
+
+    /**
+     * Method to set new unique constraint metadata for the key
+     * 
+     * @return The UniqueMetadata
+     */
+    UniqueMetadata newUniqueMetadata();
+
+    /**
+     * Accessor for any unique constraint metadata on this key.
+     * 
+     * @return The UniqueMetadata
+     */
+    UniqueMetadata getUniqueMetadata();
+
+    /**
+     * Method to set new foreign key metadata for the key
+     * 
+     * @return The ForeignKeyMetadata
+     */
+    ForeignKeyMetadata newForeignKeyMetadata();
+
+    /**
+     * Accessor for any foreign key metadata on this key.
+     * 
+     * @return The ForeignKeyMetadata
+     */
+    ForeignKeyMetadata getForeignKeyMetadata();
+}
\ No newline at end of file

Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/MapMetadata.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/MapMetadata.java?rev=724172&view=auto
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/metadata/MapMetadata.java (added)
+++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/MapMetadata.java Sun Dec  7 10:52:55 2008
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.jdo.metadata;
+
+/**
+ * Represents details of a map in a field/property in a class.
+ * @since 2.3
+ */
+public interface MapMetadata extends Metadata {
+    /**
+     * Method to set the name of the key type
+     * 
+     * @param type Name of the key type
+     */
+    void setKeyType(String type);
+
+    /**
+     * Accessor for the key type
+     * 
+     * @return The key type
+     */
+    String getKeyType();
+
+    /**
+     * Method to set whether the key is embedded
+     * 
+     * @param val Whether it is embedded
+     */
+    void setEmbeddedKey(boolean val);
+
+    /**
+     * Accessor for whether the key is embedded
+     * 
+     * @return whether the key is embedded
+     */
+    Boolean getEmbeddedKey();
+
+    /**
+     * Method to set whether the key is serialised
+     * 
+     * @param val Whether it is serialised
+     */
+    void setSerializedKey(boolean val);
+
+    /**
+     * Accessor for whether the key is serialised
+     * 
+     * @return whether the key is serialised
+     */
+    Boolean getSerializedKey();
+
+    /**
+     * Method to set whether the key is dependent
+     * 
+     * @param val Whether it is dependent
+     */
+    void setDependentKey(boolean val);
+
+    /**
+     * Accessor for whether the key is dependent
+     * 
+     * @return whether the key is dependent
+     */
+    Boolean getDependentKey();
+
+    /**
+     * Method to set the name of the value type
+     * 
+     * @param type Name of the value type
+     */
+    void setValueType(String type);
+
+    /**
+     * Accessor for the value type
+     * 
+     * @return The value type
+     */
+    String getValueType();
+
+    /**
+     * Method to set whether the value is embedded
+     * 
+     * @param val Whether it is embedded
+     */
+    void setEmbeddedValue(boolean val);
+
+    /**
+     * Accessor for whether the value is embedded
+     * 
+     * @return whether the value is embedded
+     */
+    Boolean getEmbeddedValue();
+
+    /**
+     * Method to set whether the value is serialised
+     * 
+     * @param val Whether it is serialised
+     */
+    void setSerializedValue(boolean val);
+
+    /**
+     * Accessor for whether the value is serialised
+     * 
+     * @return whether the value is serialised
+     */
+    Boolean getSerializedValue();
+
+    /**
+     * Method to set whether the value is dependent
+     * 
+     * @param val Whether it is dependent
+     */
+    void setDependentValue(boolean val);
+
+    /**
+     * Accessor for whether the value is dependent
+     * 
+     * @return whether the value is dependent
+     */
+    Boolean getDependentValue();
+}
\ No newline at end of file