1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 JDOCollection instance represents the JDO relationship metadata
25 * of a collection relationship field.
26 *
27 * @author Michael Bouschen
28 */
29 public interface JDOCollection
30 extends JDORelationship
31 {
32 /***
33 * Determines whether the values of the elements should be stored if
34 * 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 if possible as
43 * part of the instance instead of as their own instances in the datastore.
44 * @param embeddedElement <code>true</code> if elements should be stored
45 * as part of the instance
46 * @exception ModelException if impossible
47 */
48 public void setEmbeddedElement(boolean embeddedElement)
49 throws ModelException;
50
51 /***
52 * Get the type representation of the collection elements.
53 * @return the element type
54 */
55 public JavaType getElementType();
56
57 /***
58 * Set the type representation of the collection elements.
59 * @param elementType the type representation of the collection elements
60 * @exception ModelException if impossible
61 */
62 public void setElementType(JavaType elementType)
63 throws ModelException;
64
65 /***
66 * Get the type of collection elements as string.
67 * @return the element type as string
68 */
69 public String getElementTypeName();
70
71 /***
72 * Set string representation of the type of collection elements.
73 * @param elementTypeName a string representation of the type of elements in
74 * the collection.
75 * @exception ModelException if impossible
76 */
77 public void setElementTypeName(String elementTypeName)
78 throws ModelException;
79
80 }