KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jdo > spi > persistence > support > sqlstore > sql > constraint > ConstraintFieldName


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  * ConstraintFieldName.java
26  *
27  * Created on March 3, 2000
28  *
29  */

30
31 package com.sun.jdo.spi.persistence.support.sqlstore.sql.constraint;
32
33 import com.sun.jdo.spi.persistence.support.sqlstore.ActionDesc;
34
35 /**
36  */

37 public class ConstraintFieldName extends ConstraintField {
38
39     public ActionDesc desc;
40
41     public String JavaDoc name;
42
43     private boolean projection;
44
45     private final boolean prefetched;
46
47     public ConstraintFieldName(String JavaDoc name,
48                                ActionDesc desc) {
49         super();
50         this.name = name;
51         this.desc = desc;
52         this.prefetched = false;
53     }
54
55     public ConstraintFieldName(String JavaDoc name, ActionDesc desc, boolean prefetched) {
56         super();
57         this.name = name;
58         this.desc = desc;
59         // Resolve: This constructor should always be called with parameter prefetched
60
// set to true. Ideally, we should have an inheritance hierachy as follows
61
// ConstraintFieldName
62
// |
63
// ----------------------------------
64
// | |
65
// ProjectionFieldName PrefetchedFieldName
66
// then isPrefetched and isProjection can be turned into abstract methods
67
// Till we do the cleanup, parameter prefetched will just serve as a
68
// marker and its value will always be ignored.
69
assert prefetched == true;
70         this.prefetched = prefetched;
71     }
72
73     public boolean isProjection() {
74         return projection;
75     }
76
77     public void setProjection() {
78         this.projection = true;
79     }
80
81     public boolean isPrefetched() {
82         return prefetched;
83     }
84 }
85
Popular Tags