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 element in a collection/array.
    21   * @since 3.0
    22   */
    23  public interface ColumnMetadata extends Metadata {
    24      /**
    25       * Method to set the column name.
    26       *
    27       * @param name Column name
    28       */
    29      ColumnMetadata setName(String name);
    30
    31      /**
    32       * Accessor for the name of the column.
    33       *
    34       * @return The name
    35       */
    36      String getName();
    37
    38      /**
    39       * Method to set the target column (at the other side of the relation).
    40       *
    41       * @param target Target column
    42       */
    43      ColumnMetadata setTarget(String target);
    44
    45      /**
    46       * Accessor for the name of the target column.
    47       *
    48       * @return Target column name
    49       */
    50      String getTarget();
    51
    52      /**
    53       * Method to set the target field (at the other side of the relation).
    54       *
    55       * @param target Target field
    56       */
    57      ColumnMetadata setTargetField(String target);
    58
    59      /**
    60       * Accessor for the name of the target field.
    61       *
    62       * @return Target field name
    63       */
    64      String getTargetField();
    65
    66      /**
    67       * Method to set the JDBC type.
    68       *
    69       * @param type JDBC Type
    70       */
    71      ColumnMetadata setJDBCType(String type);
    72
    73      /**
    74       * Accessor for the JDBC Type
    75       *
    76       * @return JDBC Type
    77       */
    78      String getJDBCType();
    79
    80      /**
    81       * Method to set the SQL type.
    82       *
    83       * @param type SQL Type
    84       */
    85      ColumnMetadata setSQLType(String type);
    86
    87      /**
    88       * Accessor for the SQL Type
    89       *
    90       * @return SQL Type
    91       */
    92      String getSQLType();
    93
    94      /**
    95       * Method to set the length
    96       *
    97       * @param len Length
    98       */
    99      ColumnMetadata setLength(int len);
    100
    101     /**
    102      * Accessor for the length
    103      *
    104      * @return length
    105      */
    106     Integer getLength();
    107
    108     /**
    109      * Method to set the scale
    110      *
    111      * @param scale scale
    112      */
    113     ColumnMetadata setScale(int scale);
    114
    115     /**
    116      * Accessor for the scale
    117      *
    118      * @return scale
    119      */
    120     Integer getScale();
    121
    122     /**
    123      * Method to set whether it allows null.
    124      *
    125      * @param nulls Allows null?
    126      */
    127     ColumnMetadata setAllowsNull(boolean nulls);
    128
    129     /**
    130      * Accessor for whether the column allows null.
    131      *
    132      * @return Allows null?
    133      */
    134     Boolean getAllowsNull();
    135
    136     /**
    137      * Method to set the default value.
    138      *
    139      * @param val Default value
    140      */
    141     ColumnMetadata setDefaultValue(String val);
    142
    143     /**
    144      * Accessor for the default value
    145      *
    146      * @return Default value
    147      */
    148     String getDefaultValue();
    149
    150     /**
    151      * Method to set the insert value (for columns with no field/property).
    152      *
    153      * @param val Insert value
    154      */
    155     ColumnMetadata setInsertValue(String val);
    156
    157     /**
    158      * Accessor for the insert value (for columns with no field/property)
    159      *
    160      * @return Insert value
    161      */
    162     String getInsertValue();
    163 }