KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jdo > api > persistence > model > mapping > MappingFieldElement


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * MappingFieldElement.java
26  *
27  * Created on March 3, 2000, 1:11 PM
28  */

29
30 package com.sun.jdo.api.persistence.model.mapping;
31
32 import java.util.ArrayList JavaDoc;
33
34 import org.netbeans.modules.dbschema.DBMemberElement;
35
36 import com.sun.jdo.api.persistence.model.ModelException;
37
38 /**
39  *
40  * @author raccah
41  * @version %I%
42  */

43 public interface MappingFieldElement extends MappingMemberElement
44 {
45     /** Constant representing the jdo default fetch group.
46      * This is what used to be mandatory for SynerJ.
47      */

48     public static final int GROUP_DEFAULT = 1;
49
50     /** Constant representing no fetch group. */
51     public static final int GROUP_NONE = 0;
52
53     /** Constant representing an independent fetch group. All independent
54      * fetch groups must have a value less than or equal to this constant.
55      */

56     public static final int GROUP_INDEPENDENT = -1;
57
58     // TBD:unmap all components, if remove from class remove here too
59
//public void clear ();
60

61     /** Determines whether this field element is read only or not.
62      * @return <code>true</code> if the field is read only,
63      * <code>false</code> otherwise
64      */

65     public boolean isReadOnly ();
66
67     /** Set whether this field element is read only or not.
68      * @param flag - if <code>true</code>, the field element is marked as
69      * read only; otherwise, it is not
70      * @exception ModelException if impossible
71      */

72     public void setReadOnly (boolean flag) throws ModelException;
73
74     /** Determines whether this field element is in a concurrency check or not.
75      * @return <code>true</code> if the field is in a concurrency check,
76      * <code>false</code> otherwise
77      */

78     public boolean isInConcurrencyCheck ();
79
80     /** Set whether this field element is in a concurrency check or not.
81      * @param flag - if <code>true</code>, the field element is marked as
82      * being in a concurrency check; otherwise, it is not
83      * @exception ModelException if impossible
84      */

85     public void setInConcurrencyCheck (boolean flag) throws ModelException;
86
87     /** Determines whether this field element is a version field or not.
88      * @return <code>true</code> if the field is a version field,
89      * <code>false</code> otherwise
90      */

91     public boolean isVersion ();
92
93     /** Set whether this field element is a version field or not.
94      * @param flag - if <code>true</code>, the field element is marked
95      * as a version field; otherwise, it is not
96      * @exception ModelException if impossible
97      */

98     public void setVersion (boolean flag) throws ModelException;
99
100     //====================== fetch group handling ==========================
101

102     /** Get the fetch group of this field element.
103      * @return the fetch group, one of {@link #GROUP_DEFAULT},
104      * {@link #GROUP_NONE}, or anything less than or equal to
105      * {@link #GROUP_INDEPENDENT}
106      */

107     public int getFetchGroup ();
108
109     /** Set the fetch group of this field element.
110      * @param group - an integer indicating the fetch group, one of:
111      * {@link #GROUP_DEFAULT}, {@link #GROUP_NONE}, or anything less than or
112      * equal to {@link #GROUP_INDEPENDENT}
113      * @exception ModelException if impossible
114      */

115     public void setFetchGroup (int group) throws ModelException;
116
117     //======================= column handling ===========================
118

119     /** Returns the list of column names to which this mapping field is
120      * mapped.
121      * @return the names of the columns mapped by this mapping field
122      */

123     public ArrayList JavaDoc getColumns ();
124
125     /** Adds a column to the list of columns mapped by this mapping field.
126      * @param column column element to be added to the mapping
127      * @exception ModelException if impossible
128      */

129     public void addColumn (DBMemberElement column) throws ModelException;
130
131     /** Removes a column from the list of columns mapped by this mapping field.
132      * @param columnName the relative name of the column to be removed from
133      * the mapping
134      * @exception ModelException if impossible
135      */

136     public void removeColumn (String JavaDoc columnName) throws ModelException;
137 }
138
Popular Tags