View Javadoc

1   /*
2    * Copyright 2005 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at 
7    * 
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software 
11   * distributed under the License is distributed on an "AS IS" BASIS, 
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
13   * See the License for the specific language governing permissions and 
14   * limitations under the License.
15   */
16  
17  package org.apache.jdo.model.jdo;
18  
19  import org.apache.jdo.model.ModelException;
20  import org.apache.jdo.model.java.JavaType;
21  
22  
23  /***
24   * A JDOArray instance represents the JDO relationship metadata 
25   * of a array relationship field.
26   *
27   * @author Michael Bouschen
28   */
29  public interface JDOArray
30      extends JDORelationship 
31  {
32      /***
33       * Determines whether the values of the elements should be stored 
34       * if possible as part of the instance instead of as their own instances 
35       * in the datastore.
36       * @return <code>true</code> if the elements should be stored as part of 
37       * the instance; <code>false</code> otherwise
38       */
39      public boolean isEmbeddedElement();
40      
41      /***
42       * Set whether the values of the elements should be stored 
43       * if possible as part of the instance instead of as their own instances 
44       * in the datastore.
45       * @param embeddedElement flag indicating whether the elements should be 
46       * stored as part of the instance
47       * @exception ModelException if impossible
48       */
49      public void setEmbeddedElement(boolean embeddedElement)
50          throws ModelException;
51  
52      /*** 
53       * Get the type representation of the array component type. 
54       * @return the array component type
55       */
56      public JavaType getElementType();
57  
58  }