KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > amber > field > IdField


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  * Free Software Foundation, Inc.
23  * 59 Temple Place, Suite 330
24  * Boston, MA 02111-1307 USA
25  *
26  * @author Scott Ferguson
27  */

28
29 package com.caucho.amber.field;
30
31 import com.caucho.amber.table.Column;
32 import com.caucho.amber.type.Type;
33 import com.caucho.java.JavaWriter;
34
35 import java.io.IOException JavaDoc;
36 import java.util.ArrayList JavaDoc;
37
38 /**
39  * Configuration for a bean's field
40  */

41 public interface IdField extends AmberField {
42   /**
43    * Returns the columns
44    */

45   public ArrayList JavaDoc<Column> getColumns();
46
47   /**
48    * Returns type
49    */

50   public Type getType();
51
52   /**
53    * Sets true if there are multiple keys.
54    */

55   public void setKeyField(boolean isKey);
56
57   /**
58    * Returns the foreign type.
59    */

60   public String JavaDoc getForeignTypeName();
61
62   /**
63    * Returns the java type name.
64    */

65   public String JavaDoc getJavaTypeName();
66
67   /**
68    * Returns the component count.
69    */

70   public int getComponentCount();
71
72   /**
73    * Returns the generator.
74    */

75   public String JavaDoc getGenerator();
76
77   /**
78    * Generates the setter for a key property
79    */

80   public String JavaDoc generateSetKeyProperty(String JavaDoc key, String JavaDoc value)
81     throws IOException JavaDoc;
82
83   /**
84    * Generates the getter for a key property
85    */

86   public String JavaDoc generateGetKeyProperty(String JavaDoc key)
87     throws IOException JavaDoc;
88
89   /**
90    * Generates the property getter for an EJB proxy
91    *
92    * @param value the non-null value
93    */

94   public String JavaDoc generateGetProxyProperty(String JavaDoc value);
95
96   /**
97    * Generates the set clause.
98    */

99   public void generateSetGeneratedKeys(JavaWriter out, String JavaDoc pstmt)
100     throws IOException JavaDoc;
101
102   /**
103    * Generates the set for an insert.
104    */

105   public void generateCheckCreateKey(JavaWriter out)
106     throws IOException JavaDoc;
107
108   /**
109    * Generates the set for an insert.
110    */

111   public void generateSetInsert(JavaWriter out, String JavaDoc pstmt, String JavaDoc index)
112     throws IOException JavaDoc;
113
114   /**
115    * Returns the foreign type.
116    */

117   public int generateLoadForeign(JavaWriter out, String JavaDoc rs,
118                                  String JavaDoc indexVar, int index)
119     throws IOException JavaDoc;
120
121   /**
122    * Returns the foreign type.
123    */

124   public int generateLoadForeign(JavaWriter out, String JavaDoc rs,
125                                  String JavaDoc indexVar, int index,
126                                  String JavaDoc name)
127     throws IOException JavaDoc;
128
129   /**
130    * Returns a test for null.
131    */

132   public String JavaDoc generateIsNull(String JavaDoc value);
133
134   /**
135    * Returns the where code
136    */

137   public String JavaDoc generateRawWhere(String JavaDoc id);
138
139   /**
140    * Returns the key code
141    */

142   public String JavaDoc generateMatchArgWhere(String JavaDoc id);
143
144   /**
145    * Converts from an object.
146    */

147   public String JavaDoc toValue(String JavaDoc value);
148 }
149
Popular Tags