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 ordering of a collection field/property.
21   * @since 3.0
22   */
23  public interface OrderMetadata extends Metadata {
24      /**
25       * Method to set the version column name.
26       * 
27       * @param column Name of the version clumn
28       */
29      OrderMetadata setColumn(String column);
30  
31      /**
32       * Accessor for the version column name
33       * 
34       * @return The version column name
35       */
36      String getColumn();
37  
38      /**
39       * Method to set mapped-by information whether the order is present in the element class.
40       * 
41       * @param mappedBy Field/property name in which to store the ordering in the element
42       */
43      OrderMetadata setMappedBy(String mappedBy);
44  
45      /**
46       * Accessor for the mapped-by field/property name in the element class.
47       * 
48       * @return Name of field/property in element class
49       */
50      String getMappedBy();
51  
52      /**
53       * Accessor for all column(s) defined on the ordering.
54       * 
55       * @return The column(s)
56       */
57      ColumnMetadata[] getColumns();
58  
59      /**
60       * Add a column for this ordering.
61       * 
62       * @return The ColumnMetadata
63       */
64      ColumnMetadata newColumnMetadata();
65  
66      /**
67       * Accessor for the number of columns defined for this ordering.
68       * 
69       * @return The number of columns
70       */
71      int getNumberOfColumns();
72  
73      /**
74       * Method to set index metadata for the ordering
75       * 
76       * @return The metadata for any index
77       */
78      IndexMetadata newIndexMetadata();
79  
80      /**
81       * Accessor for any index metadata for the ordering
82       * 
83       * @return Index metadata
84       */
85      IndexMetadata getIndexMetadata();
86  }