View Javadoc

    1   /*
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  You may obtain a copy of the License at
    8    *
    9    *     http://www.apache.org/licenses/LICENSE-2.0
    10   *
    11   * Unless required by applicable law or agreed to in writing, software
    12   * distributed under the License is distributed on an "AS IS" BASIS,
    13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14   * See the License for the specific language governing permissions and
    15   * limitations under the License.
    16   */
    17  package javax.jdo.metadata;
    18
    19  /**
    20   * Represents an index.
    21   * @since 3.0
    22   */
    23  public interface IndexMetadata extends Metadata {
    24      /**
    25       * Method to set the name of the index
    26       *
    27       * @param name Name of the index
    28       */
    29      IndexMetadata setName(String name);
    30
    31      /**
    32       * Accessor for the index name.
    33       *
    34       * @return The index name
    35       */
    36      String getName();
    37
    38      /**
    39       * Method to set the table name.
    40       *
    41       * @param table Table name
    42       */
    43      IndexMetadata setTable(String table);
    44
    45      /**
    46       * Accessor for the name of the table.
    47       *
    48       * @return The name
    49       */
    50      String getTable();
    51
    52      /**
    53       * Method to set whether it is unique.
    54       *
    55       * @param unique Unique?
    56       */
    57      IndexMetadata setUnique(boolean unique);
    58
    59      /**
    60       * Accessor for whether unique.
    61       *
    62       * @return Unique?
    63       */
    64      boolean getUnique();
    65
    66      /**
    67       * Accessor for all column(s) defined on the index.
    68       *
    69       * @return The column(s)
    70       */
    71      ColumnMetadata[] getColumns();
    72
    73      /**
    74       * Add a new column for this index.
    75       *
    76       * @return The ColumnMetadata
    77       */
    78      ColumnMetadata newColumn();
    79
    80      /**
    81       * Accessor for the number of columns defined for this index.
    82       *
    83       * @return The number of columns
    84       */
    85      int getNumberOfColumns();
    86
    87      /**
    88       * Accessor for all member(s) defined on the index.
    89       *
    90       * @return The fields/properties
    91       */
    92      MemberMetadata[] getMembers();
    93
    94      /**
    95       * Accessor for the number of fields/properties defined for this index.
    96       *
    97       * @return The number of members
    98       */
    99      int getNumberOfMembers();
    100
    101     /**
    102      * Add a new field for this index.
    103      *
    104      * @param name Name of the field
    105      * @return The FieldMetadata
    106      */
    107     FieldMetadata newFieldMetadata(String name);
    108
    109     /**
    110      * Add a new property for this index.
    111      *
    112      * @param name Name of the property
    113      * @return The PropertyMetadata
    114      */
    115     PropertyMetadata newPropertyMetadata(String name);
    116 }