Return-Path: Delivered-To: apmail-db-jdo-commits-archive@www.apache.org Received: (qmail 423 invoked from network); 7 Dec 2008 18:53:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Dec 2008 18:53:49 -0000 Received: (qmail 40273 invoked by uid 500); 7 Dec 2008 18:54:02 -0000 Mailing-List: contact jdo-commits-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-commits@db.apache.org Received: (qmail 40264 invoked by uid 99); 7 Dec 2008 18:54:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Dec 2008 10:54:02 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Dec 2008 18:52:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A62942388920; Sun, 7 Dec 2008 10:52:57 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r724172 [2/2] - /db/jdo/trunk/api2/src/java/javax/jdo/metadata/ Date: Sun, 07 Dec 2008 18:52:56 -0000 To: jdo-commits@db.apache.org From: andyj@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081207185257.A62942388920@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/MemberMetadata.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/MemberMetadata.java?rev=724172&view=auto ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/metadata/MemberMetadata.java (added) +++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/MemberMetadata.java Sun Dec 7 10:52:55 2008 @@ -0,0 +1,477 @@ +/* + * 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; +import javax.jdo.annotations.NullValue; +import javax.jdo.annotations.PersistenceModifier; + +/** + * Represents a field/property in a class/persistent-interface. + * @since 2.3 + */ +public interface MemberMetadata extends Metadata { + /** + * Method to set the name. + * + * @param name name + */ + void setName(String name); + + /** + * Accessor for the name of the field/property. + * + * @return The 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 the column name. + * + * @param col Column name + */ + void setColumn(String col); + + /** + * Accessor for the name of the column. + * + * @return The column name + */ + String getColumn(); + + /** + * Method to set the field type(s). For defining where we want to restrict + * what type is stored in a field + * + * @param type Type of field + */ + void setFieldType(String type); + + /** + * Accessor for the type storable in the field + * + * @return The field type + */ + String getFieldType(); + + /** + * 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 persistence-modifier of the field/property. + * + * @param mod persistence modifier + */ + void setPersistenceModifier(PersistenceModifier mod); + + /** + * Accessor for the persistence modifier of the field/property. + * + * @return The persistence modifier + */ + PersistenceModifier getPersistenceModifier(); + + /** + * Method to set the behaviour of a null value + * + * @param val Null value behaviour + */ + void setNullValue(NullValue val); + + /** + * Accessor for the behaviour of a null value + * + * @return The null value behaviour + */ + NullValue getNullValue(); + + /** + * Method to set whether it is in the DFG. + * + * @param dfg DFG? + */ + void setDefaultFetchGroup(boolean dfg); + + /** + * Accessor for whether part of the DFG. + * + * @return dfg? + */ + Boolean getDefaultFetchGroup(); + + /** + * Method to set whether it is unique. + * + * @param unique Unique? + */ + void setDependent(boolean unique); + + /** + * Accessor for whether unique. + * + * @return Unique? + */ + Boolean getDependent(); + + /** + * Method to set whether it is embedded. + * + * @param emb Embedded? + */ + void setEmbedded(boolean emb); + + /** + * Accessor for whether it is embedded. + * + * @return embedded? + */ + Boolean getEmbedded(); + + /** + * Method to set whether it is serialized. + * + * @param ser serialized? + */ + void setSerialized(boolean ser); + + /** + * Accessor for whether it is serialized. + * + * @return serialized? + */ + Boolean getSerialized(); + + /** + * Method to set whether it is part of the pk + * + * @param pk PK? + */ + void setPrimaryKey(boolean unique); + + /** + * Accessor for whether it is part of the pk. + * + * @return pk? + */ + boolean getPrimaryKey(); + + /** + * Method to set whether it is indexed. + * + * @param index Indexed? + */ + void setIndexed(boolean index); + + /** + * Accessor for whether it is indexed. + * + * @return Indexed? + */ + Boolean 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 whether this is cacheable + * + * @param cacheable Cacheable? + */ + void setCacheable(boolean cacheable); + + /** + * Accessor for whether this is cacheable. + * + * @return Detachable? + */ + boolean getCacheable(); + + /** + * Method to set the recursion depth (when used in a fetch group). + * + * @param depth Recursion depth + */ + void setRecursionDepth(int depth); + + /** + * Accessor for the recursion depth (when part of a fetch group). + * + * @return Recursion depth? + */ + int getRecursionDepth(); + + /** + * Method to set the load fetch group. + * + * @param grp Load fetch group + */ + void setLoadFetchGroup(String type); + + /** + * Accessor for the name of the load fetch group + * + * @return The load fetch group + */ + String getLoadFetchGroup(); + + /** + * Method to set the value strategy + * + * @param str Value strategy + */ + void setValueStrategy(String str); + + /** + * Accessor for the value strategy + * + * @return Value strategy + */ + String getValueStrategy(); + + /** + * 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 (when using value-strategy of "sequence") + * + * @param seq Sequence key + */ + void setSequence(String seq); + + /** + * Accessor for the sequence (when using value-strategy of "sequence") + * + * @return Sequence key + */ + String getSequence(); + + /** + * Method to set the field on the other side of a bidirectional relation + * (this side is owner) + * + * @param map mapped-by field/property + */ + void setMappedBy(String map); + + /** + * Accessor for the mapped-by field/property + * + * @return mapped-by field/property + */ + String getMappedBy(); + + /** + * Method to define the array details (if the field/property is an array) + * + * @return The ArrayMetadata + */ + ArrayMetadata newArrayMetadata(); + + /** + * Accessor for the array details. + * + * @return array details + */ + ArrayMetadata getArrayMetadata(); + + /** + * Method to define the array details (if the field/property is an array) + * + * @return The ArrayMetadata + */ + CollectionMetadata newCollectionMetadata(); + + /** + * Accessor for the array details. + * + * @return array details + */ + CollectionMetadata getCollectionMetadata(); + + /** + * Method to define the map details (if the field/property is an map) + * + * @return The MapMetadata + */ + MapMetadata newMapMetadata(); + + /** + * Accessor for the map details. + * + * @return map details + */ + MapMetadata getMapMetadata(); + + /** + * Method to define the join details + * + * @return The JoinMetadata + */ + JoinMetadata newJoinMetadata(); + + /** + * Accessor for the join details. + * + * @return join details + */ + JoinMetadata getJoinMetadata(); + + /** + * Method to define the embedded details + * + * @return The EmbeddedMetadata + */ + EmbeddedMetadata newEmbeddedMetadata(); + + /** + * Accessor for the embedded metadata. + * + * @return embedded metadata + */ + EmbeddedMetadata getEmbeddedMetadata(); + + /** + * Method to define the new element details + * + * @return The ElementMetadata + */ + ElementMetadata newElementMetadata(); + + /** + * Accessor for the element details + * + * @return element details + */ + ElementMetadata getElementMetadata(); + + /** + * Method to define the key details + * + * @return The KeyMetadata + */ + KeyMetadata newKeyMetadata(); + + /** + * Accessor for the key details + * + * @return key details + */ + KeyMetadata getKeyMetadata(); + + /** + * Method to define the value details + * + * @return The ValueMetadata + */ + ValueMetadata newValueMetadata(); + + /** + * Accessor for the value details + * + * @return value details + */ + ValueMetadata getValueMetadata(); + + /** + * Method to set index metadata for the field/property + * + * @param index The metadata for any index + */ + IndexMetadata newIndexMetadata(); + + /** + * Accessor for any index metadata for the field/property + * + * @return Index metadata + */ + IndexMetadata getIndexMetadata(); + + /** + * Method to set new unique constraint metadata for the field/property + * + * @return The UniqueMetadata + */ + UniqueMetadata newUniqueMetadata(); + + /** + * Accessor for any unique constraint metadata on this field/property. + * + * @return The UniqueMetadata + */ + UniqueMetadata getUniqueMetadata(); + + /** + * Method to set new foreign key metadata for the field/property + * + * @return The ForeignKeyMetadata + */ + ForeignKeyMetadata newForeignKeyMetadata(); + + /** + * Accessor for any foreign key metadata on this field/property. + * + * @return The ForeignKeyMetadata + */ + ForeignKeyMetadata getForeignKeyMetadata(); +} \ No newline at end of file Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/Metadata.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/Metadata.java?rev=724172&view=auto ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/metadata/Metadata.java (added) +++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/Metadata.java Sun Dec 7 10:52:55 2008 @@ -0,0 +1,55 @@ +/* + * 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; + +/** + * This interface provides base level definitions for all metadata components. + * + * @version 2.3 + */ +public interface Metadata { + /** + * Add a vendor extension to this metadata component. + * + * @param vendor Identifier for the vendor + * @param key The extension key + * @param value Value for the extension + * @return The ExtensionMetaData + */ + ExtensionMetadata newExtensionMetaData(String vendor, String key, String value); + + /** + * Number of extensions on this component. + * + * @return Number of extensions + */ + int getNumberOfExtensions(); + + /** + * Accessor for the defined extensions for this component + * + * @return The extensions + */ + ExtensionMetadata[] getExtensions(); + + /** + * Accessor for the parent metadata component. + * + * @return The parent + */ + Metadata getParent(); +} \ No newline at end of file Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/OrderMetadata.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/OrderMetadata.java?rev=724172&view=auto ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/metadata/OrderMetadata.java (added) +++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/OrderMetadata.java Sun Dec 7 10:52:55 2008 @@ -0,0 +1,86 @@ +/* + * 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 ordering of a collection field/property. + * @since 2.3 + */ +public interface OrderMetadata extends Metadata { + /** + * Method to set the version column name. + * + * @param column Name of the version clumn + */ + void setColumn(String column); + + /** + * Accessor for the version column name + * + * @return The version column name + */ + String getColumn(); + + /** + * Method to set mapped-by information whether the order is present in the element class. + * + * @param mappedBy Field/property name in which to store the ordering in the element + */ + void setMappedBy(String mappedBy); + + /** + * Accessor for the mapped-by field/property name in the element class. + * + * @return Name of field/property in element class + */ + String getMappedBy(); + + /** + * Accessor for all column(s) defined on the ordering. + * + * @return The column(s) + */ + ColumnMetadata[] getColumns(); + + /** + * Add a column for this ordering. + * + * @return The ColumnMetadata + */ + ColumnMetadata newColumnMetadata(); + + /** + * Accessor for the number of columns defined for this ordering. + * + * @return The number of columns + */ + int getNumberOfColumns(); + + /** + * Method to set index metadata for the ordering + * + * @param index The metadata for any index + */ + IndexMetadata newIndexMetadata(); + + /** + * Accessor for any index metadata for the ordering + * + * @return Index metadata + */ + IndexMetadata getIndexMetadata(); +} \ No newline at end of file Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/PackageMetadata.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/PackageMetadata.java?rev=724172&view=auto ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/metadata/PackageMetadata.java (added) +++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/PackageMetadata.java Sun Dec 7 10:52:55 2008 @@ -0,0 +1,128 @@ +/* + * 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.SequenceStrategy; + +/** + * Represents a package within a JDOMetadata. + * @since 2.3 + */ +public interface PackageMetadata extends Metadata { + /** + * Accessor for the name of this package (set on construction). + * + * @return The name + */ + String getName(); + + /** + * Method to set the catalog (ORM) to apply to all classes in this package. + * + * @param catalog Catalog name + */ + void setCatalog(String catalog); + + /** + * Accessor for the catalog (ORM) that all classes in this package default + * to. + * + * @return The catalog + */ + String getCatalog(); + + /** + * Method to set the schema (ORM) to apply to all classes in this package. + * + * @param schema Schema name + */ + void setSchema(String schema); + + /** + * Accessor for the schema (ORM) that all classes in this package default to. + * + * @return The schema + */ + String getSchema(); + + /** + * Accessor for all classes defined in this package. + * + * @return The classes + */ + ClassMetadata[] getClasses(); + + /** + * Add a new class to this package. + * + * @param name Name of the class + * @return The ClassMetadata + */ + ClassMetadata newClassMetadata(String name); + + /** + * Accessor for the number of classes defined in this package. + * + * @return The number of classes. + */ + int getNumberOfClasses(); + + /** + * Accessor for all interfaces defined in this package. + * + * @return The interfaces + */ + InterfaceMetadata[] getInterfaces(); + + /** + * Add a new interface to this package. + * + * @param name The interface name + * @return The InterfaceMetadata + */ + InterfaceMetadata newInterfaceMetadata(String name); + + /** + * Accessor for the number of interfaces defined in this package. + * + * @return The number of interfaces. + */ + int getNumberOfInterfaces(); + + /** + * Accessor for any sequences defined on the package. + * + * @return The sequences + */ + SequenceMetadata[] getSequences(); + + /** + * Add a new sequence to this package. + * + * @param name Name of the sequence + * @param strategy Strategy for the sequence + * @return The SequenceMetadata + */ + SequenceMetadata newSequenceMetadata(String name, SequenceStrategy strategy); + + /** + * Accessor for the number of sequences defined for this package. + * + * @return The number of sequences. + */ + int getNumberOfSequences(); +} \ No newline at end of file Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/PrimaryKeyMetadata.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/PrimaryKeyMetadata.java?rev=724172&view=auto ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/metadata/PrimaryKeyMetadata.java (added) +++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/PrimaryKeyMetadata.java Sun Dec 7 10:52:55 2008 @@ -0,0 +1,72 @@ +/* + * 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 primary key definition of a class. + * @since 2.3 + */ +public interface PrimaryKeyMetadata extends Metadata { + /** + * Method to set the name of the PK constraint. + * + * @param name Name of the PK constraint + */ + void setName(String strategy); + + /** + * Accessor for the name of the PK constraint. + * + * @return The PK constraint name + */ + String getName(); + + /** + * Method to set the PK column name. + * + * @param column Name of the PK column + */ + void setColumn(String column); + + /** + * Accessor for the PK column name + * + * @return The column name + */ + String getColumn(); + + /** + * Accessor for all column(s) defined on the PK. + * + * @return The column(s) + */ + ColumnMetadata[] getColumns(); + + /** + * Add a new column for this PK + * + * @return The ColumnMetadata + */ + ColumnMetadata newColumnMetadata(); + + /** + * Accessor for the number of columns defined for this PK + * + * @return The number of columns + */ + int getNumberOfColumns(); +} \ No newline at end of file Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/PropertyMetadata.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/PropertyMetadata.java?rev=724172&view=auto ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/metadata/PropertyMetadata.java (added) +++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/PropertyMetadata.java Sun Dec 7 10:52:55 2008 @@ -0,0 +1,37 @@ +/* + * 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 property in a class/persistent-interface. + * @since 2.3 + */ +public interface PropertyMetadata extends MemberMetadata { + /** + * Method to set the field name (persistent interfaces) + * + * @param name field name + */ + void setFieldName(String str); + + /** + * Accessor for the field name + * + * @return Field name + */ + String getFieldName(); +} \ No newline at end of file Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/QueryMetadata.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/QueryMetadata.java?rev=724172&view=auto ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/metadata/QueryMetadata.java (added) +++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/QueryMetadata.java Sun Dec 7 10:52:55 2008 @@ -0,0 +1,112 @@ +/* + * 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 named query. + * @since 2.3 + */ +public interface QueryMetadata extends Metadata { + /** + * Accessor for the name of the query (set on construction). + * + * @return The name + */ + String getName(); + + /** + * Method to set the language of the query. + * + * @param lang Query language + */ + void setLanguage(String lang); + + /** + * Accessor for the query language. + * + * @return The language + */ + String getLanguage(); + + /** + * Method to set the single-string query. + * + * @param query The query + */ + void setQuery(String query); + + /** + * Accessor for the single-string query. + * + * @return The query + */ + String getQuery(); + + /** + * Method to set the result class name for the query + * + * @param clsName Result class name + */ + void setResultClass(String clsName); + + /** + * Accessor for the result class name for the query. + * + * @return The result class name + */ + String getResultClass(); + + /** + * Method to set if the query results are unique + * + * @param unique Whether they are unique + */ + void setUnique(boolean unique); + + /** + * Accessor for whether results from the query are unique + * + * @return Results are unique? + */ + Boolean getUnique(); + + /** + * Method to set the query as not being modifiable from now. + */ + void setUnmodifiable(); + + /** + * Accessor for whether the query is unmodifiable. + * + * @return Can't be changed? + */ + boolean getUnmodifiable(); + + /** + * Method to set the FetchPlan to use for this named query. + * + * @param fetchPlanName name of the FetchPlan + */ + void setFetchPlan(String fetchPlanName); + + /** + * Accessor for the name of a fetch plan to use (if any). + * + * @return The fetch plan name + */ + String getFetchPlan(); +} \ No newline at end of file Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/SequenceMetadata.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/SequenceMetadata.java?rev=724172&view=auto ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/metadata/SequenceMetadata.java (added) +++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/SequenceMetadata.java Sun Dec 7 10:52:55 2008 @@ -0,0 +1,67 @@ +/* + * 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.SequenceStrategy; + +/** + * Represents a sequence. + * @since 2.3 + */ +public interface SequenceMetadata extends Metadata { + /** + * Accessor for the name of the sequence (set on construction). + * + * @return The name + */ + String getName(); + + /** + * Accessor for the sequence strategy (set on construction). + * + * @return Sequence strategy + */ + SequenceStrategy getSequenceStrategy(); + + /** + * Method to set the name of the datastore sequence that this maps to. + * + * @param seq Datastore sequence name + */ + void setDatastoreSequence(String seq); + + /** + * Accessor for the name of the datastore sequence that this maps to + * + * @return The datastore sequence name + */ + String getDatastoreSequence(); + + /** + * Method to set the result class name for the query + * + * @param clsName Result class name + */ + void setFactoryClass(String clsName); + + /** + * Accessor for the factory class for this sequence. + * + * @return The factory class + */ + String getFactoryClass(); +} \ No newline at end of file Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/UniqueMetadata.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/UniqueMetadata.java?rev=724172&view=auto ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/metadata/UniqueMetadata.java (added) +++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/UniqueMetadata.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 a unique constraint. + * @since 2.3 + */ +public interface UniqueMetadata 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 the constraint is deferred. + * + * @param def Deferred? + */ + void setDeferred(boolean def); + + /** + * Accessor for whether deferred. + * + * @return Deferred? + */ + Boolean getDeferred(); + + /** + * Accessor for all column(s) defined on the unique constraint. + * + * @return The column(s) + */ + ColumnMetadata[] getColumns(); + + /** + * Add a new column for this unique constraint. + * + * @return The ColumnMetadata + */ + ColumnMetadata newColumnMetadata(); + + /** + * Accessor for the number of columns defined for this unique constraint. + * + * @return The number of columns + */ + int getNumberOfColumns(); + + /** + * Accessor for all field(s) defined on the unique constraint. + * + * @return The field(s) + */ + FieldMetadata[] getFields(); + + /** + * Add a new field for this unique constraint. + * + * @param name Name of the field + * @return The FieldMetadata + */ + FieldMetadata newFieldMetadata(String name); + + /** + * Accessor for the number of fields defined for this unique constraint. + * + * @return The number of fields + */ + int getNumberOfFields(); + + /** + * Accessor for all properties defined on the unique constraint. + * + * @return The properties + */ + PropertyMetadata[] getProperties(); + + /** + * Add a new property for this unique constraint. + * + * @param name Name of the property + * @return The PropertyMetadata + */ + PropertyMetadata newPropertyMetadata(String name); + + /** + * Accessor for the number of properties defined for this unique constraint. + * + * @return The number of properties + */ + int getNumberOfProperties(); +} \ No newline at end of file Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/ValueMetadata.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/ValueMetadata.java?rev=724172&view=auto ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/metadata/ValueMetadata.java (added) +++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/ValueMetadata.java Sun Dec 7 10:52:55 2008 @@ -0,0 +1,137 @@ +/* + * 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 value in a map. + * @since 2.3 + */ +public interface ValueMetadata 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(); + + /** + * Method to set new embedded metadata for the value. + * + * @return The EmbeddedMetadata + */ + EmbeddedMetadata setEmbeddedMetadata(); + + /** + * Accessor for any embedded metadata on this value + * + * @return The EmbeddedMetadata + */ + EmbeddedMetadata getEmbeddedMetadata(); + + /** + * Method to set new index metadata for the value. + * + * @return The IndexMetadata + */ + IndexMetadata setIndexMetadata(); + + /** + * Accessor for any index metadata on this value + * + * @return Index metadata + */ + IndexMetadata getIndexMetadata(); + + /** + * Method to set new unique constraint metadata for the value + * + * @return The UniqueMetadata + */ + UniqueMetadata setUniqueMetadata(); + + /** + * Accessor for any unique constraint metadata on this value. + * + * @return The UniqueMetadata + */ + UniqueMetadata getUniqueMetadata(); + + /** + * Method to set new foreign key metadata for the value + * + * @return The ForeignKeyMetadata + */ + ForeignKeyMetadata setForeignKeyMetadata(); + + /** + * Accessor for any foreign key metadata on this value. + * + * @return The ForeignKeyMetadata + */ + ForeignKeyMetadata getForeignKeyMetadata(); +} \ No newline at end of file Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/VersionMetadata.java URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/VersionMetadata.java?rev=724172&view=auto ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/metadata/VersionMetadata.java (added) +++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/VersionMetadata.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 versioning of a class. + * @since 2.3 + */ +public interface VersionMetadata extends Metadata { + /** + * Method to set the version strategy. + * + * @param strategy The strategy + */ + void setStrategy(VersionStrategy strategy); + + /** + * Accessor for the version strategy. + * + * @return The strategy + */ + VersionStrategy getStrategy(); + + /** + * Method to set the version column name. + * + * @param column Name of the version clumn + */ + void setColumn(String column); + + /** + * Accessor for the version column name + * + * @return The version column name + */ + String getColumn(); + + /** + * 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 version. + * + * @return The column(s) + */ + ColumnMetadata[] getColumns(); + + /** + * Add a new column for this version. + * + * @return The ColumnMetadata + */ + ColumnMetadata newColumnMetadata(); + + /** + * Accessor for the number of columns defined for this version. + * + * @return The number of columns + */ + int getNumberOfColumns(); + + /** + * Method to set index metadata for the version + * + * @version The IndexMetadata + */ + IndexMetadata newIndexMetadata(); + + /** + * Accessor for any index metadata on this version + * + * @return Index metadata + */ + IndexMetadata getIndexMetadata(); +} \ No newline at end of file Added: db/jdo/trunk/api2/src/java/javax/jdo/metadata/package.html URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/metadata/package.html?rev=724172&view=auto ============================================================================== --- db/jdo/trunk/api2/src/java/javax/jdo/metadata/package.html (added) +++ db/jdo/trunk/api2/src/java/javax/jdo/metadata/package.html Sun Dec 7 10:52:55 2008 @@ -0,0 +1,28 @@ + + + + +MetaData package + + + + + This package contains classes representing the different components of the JDO MetaData. + It mirrors the structure of the XML schema. + +