KickJava   Java API By Example, From Geeks To Geeks.

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


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  * ConstraintParamIndex.java
26  *
27  * Created on March 12, 2002
28  * @author Daniel Tonn
29  */

30
31 package com.sun.jdo.spi.persistence.support.sqlstore.sql.constraint;
32
33 import com.sun.jdo.spi.persistence.support.sqlstore.model.LocalFieldDesc;
34
35 /**
36  * Constraint which represent an index of a query parameter.
37  * This index is put to the stack and used
38  * to bind the real value of the parameter to the query.
39  */

40 public class ConstraintParamIndex extends ConstraintValue
41 {
42
43     /**
44      * com.sun.jdo.spi.persistence.utility.FieldTypeEnumeration constant
45      * for type of this parameter.
46      *
47      */

48     int enumType;
49
50     /**
51      * Constructor.
52      * @param index parameter index
53      * @param enumType type of this parameter
54      * @param localField the localField to which this parameter is bound.
55      */

56     public ConstraintParamIndex(int index, int enumType, LocalFieldDesc localField) {
57         super(new Integer JavaDoc(index), localField);
58         this.enumType = enumType;
59     }
60
61     /**
62      * Get type of this parameter.
63      */

64     public int getType() {
65         return enumType;
66     }
67     
68     public Integer JavaDoc getIndex() {
69         return (Integer JavaDoc) getValue();
70     }
71
72 }
73
Popular Tags