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  import javax.jdo.annotations.ForeignKeyAction;
    20
    21  /**
    22   * Represents an element in a collection/array.
    23   * @since 3.0
    24   */
    25  public interface ElementMetadata extends Metadata {
    26      /**
    27       * Method to set the column name.
    28       *
    29       * @param column Column name
    30       */
    31      ElementMetadata setColumn(String column);
    32
    33      /**
    34       * Accessor for the name of the column.
    35       *
    36       * @return The name
    37       */
    38      String getColumn();
    39
    40      /**
    41       * Method to set the table name.
    42       *
    43       * @param table Table name
    44       */
    45      ElementMetadata setTable(String table);
    46
    47      /**
    48       * Accessor for the name of the table.
    49       *
    50       * @return The name
    51       */
    52      String getTable();
    53
    54      /**
    55       * Method to set the delete action of the FK
    56       *
    57       * @param action Delete action of the FK
    58       */
    59      ElementMetadata setDeleteAction(ForeignKeyAction action);
    60
    61      /**
    62       * Accessor for the delete action of the FK
    63       *
    64       * @return The FK delete-action
    65       */
    66      ForeignKeyAction getDeleteAction();
    67
    68      /**
    69       * Method to set the update action of the FK
    70       *
    71       * @param action Update action of the FK
    72       */
    73      ElementMetadata setUpdateAction(ForeignKeyAction action);
    74
    75      /**
    76       * Accessor for the update action of the FK
    77       *
    78       * @return The FK update-action
    79       */
    80      ForeignKeyAction getUpdateAction();
    81
    82      /**
    83       * Accessor for all column(s) defined on the element.
    84       *
    85       * @return The column(s)
    86       */
    87      ColumnMetadata[] getColumns();
    88
    89      /**
    90       * Add a new column for this element.
    91       *
    92       * @return The ColumnMetadata
    93       */
    94      ColumnMetadata newColumnMetadata();
    95
    96      /**
    97       * Accessor for the number of columns defined for this element.
    98       *
    99       * @return The number of columns
    100      */
    101     int getNumberOfColumns();
    102
    103     /**
    104      * Method to set new embedded metadata for the element.
    105      *
    106      * @return The EmbeddedMetadata
    107      */
    108     EmbeddedMetadata newEmbeddedMetadata();
    109
    110     /**
    111      * Accessor for any embedded metadata on this element
    112      *
    113      * @return The EmbeddedMetadata
    114      */
    115     EmbeddedMetadata getEmbeddedMetadata();
    116
    117     /**
    118      * Method to set new index metadata for the element.
    119      *
    120      * @return The IndexMetadata
    121      */
    122     IndexMetadata newIndexMetadata();
    123
    124     /**
    125      * Accessor for any index metadata on this element
    126      *
    127      * @return Index metadata
    128      */
    129     IndexMetadata getIndexMetadata();
    130
    131     /**
    132      * Method to set new unique constraint metadata for the element
    133      *
    134      * @return The UniqueMetadata
    135      */
    136     UniqueMetadata newUniqueMetadata();
    137
    138     /**
    139      * Accessor for any unique constraint metadata on this element.
    140      *
    141      * @return The UniqueMetadata
    142      */
    143     UniqueMetadata getUniqueMetadata();
    144
    145     /**
    146      * Method to set new foreign key metadata for the element
    147      *
    148      * @return The ForeignKeyMetadata
    149      */
    150     ForeignKeyMetadata newForeignKeyMetadata();
    151
    152     /**
    153      * Accessor for any foreign key metadata on this element.
    154      *
    155      * @return The ForeignKeyMetadata
    156      */
    157     ForeignKeyMetadata getForeignKeyMetadata();
    158 }