KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb > plugins > cmp > jdbc > bridge > JDBCFieldBridge


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.ejb.plugins.cmp.jdbc.bridge;
23
24 import java.sql.PreparedStatement JavaDoc;
25 import java.sql.ResultSet JavaDoc;
26
27 import org.jboss.ejb.EntityEnterpriseContext;
28 import org.jboss.ejb.plugins.cmp.bridge.FieldBridge;
29 import org.jboss.ejb.plugins.cmp.jdbc.JDBCType;
30 import org.jboss.ejb.plugins.cmp.jdbc.JDBCEntityPersistenceStore;
31
32
33 /**
34  * @author <a HREF="mailto:loubyansky@ua.fm">Alex Loubyansky and others</a>
35  */

36 public interface JDBCFieldBridge extends FieldBridge
37 {
38    /** Gets the JDBC type of this field. */
39    public JDBCType getJDBCType();
40
41    /**
42     * Is this field a member of the primary key.
43     * @return true if this field is a member of the primary key
44     */

45    public boolean isPrimaryKeyMember();
46
47    /**
48     * Is this field read only.
49     * @return true if this field is read only
50     */

51    public boolean isReadOnly();
52
53    /**
54     * Has current data read timed out?
55     */

56    public boolean isReadTimedOut(EntityEnterpriseContext ctx);
57
58    /**
59     * Has the data been loaded?
60     */

61    public boolean isLoaded(EntityEnterpriseContext ctx);
62
63    /**
64     * Set CMPFieldValue to Java default value (i.e., 0 or null).
65     */

66    public void initInstance(EntityEnterpriseContext ctx);
67
68    /**
69     * Resets any persistence data maintained in the context.
70     */

71    public void resetPersistenceContext(EntityEnterpriseContext ctx);
72
73    /**
74     * Sets the prepared statement parameters with the data from the
75     * instance associated with the context.
76     */

77    public int setInstanceParameters(PreparedStatement JavaDoc ps, int parameterIndex, EntityEnterpriseContext ctx);
78
79    /**
80     * Gets the internal value of this field without user level checks.
81     * @param ctx the context for which this field's value should be fetched
82     * @return the value of this field
83     */

84    public Object JavaDoc getInstanceValue(EntityEnterpriseContext ctx);
85
86    /**
87     * Sets the internal value of this field without user level checks.
88     * @param ctx the context for which this field's value should be set
89     * @param value the new value of this field
90     */

91    public void setInstanceValue(EntityEnterpriseContext ctx, Object JavaDoc value);
92
93    /**
94     * Loads the data from result set into the instance associated with
95     * the specified context.
96     */

97    public int loadInstanceResults(ResultSet JavaDoc rs, int parameterIndex, EntityEnterpriseContext ctx);
98
99    /**
100     * Loads the value of this cmp field from result set into argument referance.
101     */

102    public int loadArgumentResults(ResultSet JavaDoc rs, int parameterIndex, Object JavaDoc[] argumentRef);
103
104    /**
105     * Has the value of this field changes since the last time clean was called.
106     */

107    public boolean isDirty(EntityEnterpriseContext ctx);
108
109    /**
110     * Mark this field as clean.
111     */

112    public void setClean(EntityEnterpriseContext ctx);
113
114    boolean isCMPField();
115
116    JDBCEntityPersistenceStore getManager();
117
118    Object JavaDoc getPrimaryKeyValue(Object JavaDoc arg);
119 }
120
Popular Tags