Source Code Cross Referenced for TypeHandler.java in  » Database-ORM » ODAL » com » completex » objective » components » persistency » type » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » ODAL » com.completex.objective.components.persistency.type 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         *  Objective Database Abstraction Layer (ODAL)
003:         *  Copyright (c) 2004, The ODAL Development Group
004:         *  All rights reserved.
005:         *  For definition of the ODAL Development Group please refer to LICENCE.txt file
006:         *
007:         *  Distributable under LGPL license.
008:         *  See terms of license at gnu.org.
009:         */package com.completex.objective.components.persistency.type;
010:
011:        import com.completex.objective.components.persistency.PersistentObject;
012:        import com.completex.objective.components.persistency.ColumnType;
013:        import com.completex.objective.components.persistency.OdalPersistencyException;
014:        import com.completex.objective.components.persistency.core.DatabasePolicy;
015:
016:        import java.sql.CallableStatement;
017:        import java.sql.PreparedStatement;
018:        import java.sql.ResultSet;
019:        import java.sql.SQLException;
020:
021:        /**
022:         * Class to handle database reads and binds
023:         *
024:         * @author Gennady Krizhevsky
025:         */
026:        public interface TypeHandler {
027:
028:            final static int DEFAULT_CHUNK_SIZE = 2048;
029:
030:            final static byte[] MINIMAL_BYTE_ARRAY = new byte[1];
031:            final static String MINIMAL_CLOB_STRING = " ";
032:
033:            /**
034:             * Defines how to extract value from ResultSet by column index
035:             *
036:             * @param resultSet      ResultSet
037:             * @param jdbcColIndex   1-based ResultSet column index
038:             * @param databasePolicy database policy
039:             * @return a <code>java.lang.Object</code> holding the column value
040:             * @throws SQLException
041:             * @see DatabasePolicy
042:             */
043:            Object handleRead(ResultSet resultSet, int jdbcColIndex,
044:                    DatabasePolicy databasePolicy) throws SQLException;
045:
046:            /**
047:             * Defines how to extract value from ResultSet by column name
048:             *
049:             * @param resultSet
050:             * @param columnName     ResultSet column name
051:             * @param databasePolicy database policy
052:             * @return a <code>java.lang.Object</code> holding the column value
053:             * @throws SQLException
054:             * @see DatabasePolicy
055:             */
056:            Object handleRead(ResultSet resultSet, String columnName,
057:                    DatabasePolicy databasePolicy) throws SQLException;
058:
059:            /**
060:             * Defines how to bind values for column of specific type. It is used for not null values only
061:             *
062:             * @param statement      PreparedStatement
063:             * @param parameterIndex 1-based binding index
064:             * @param value          value to bind
065:             * @throws SQLException
066:             */
067:            void handleBind(PreparedStatement statement, int parameterIndex,
068:                    Object value) throws SQLException;
069:
070:            /**
071:             * Defines how to bind values of PersistentObject in update/insert operations. It is used for not null values only
072:             *
073:             * @param statement        PreparedStatement
074:             * @param jdbcColIndex     1-based binding index
075:             * @param value            value to bind
076:             * @param databasePolicy   database policy
077:             * @param postProcessings  post processings used for LOBs for example
078:             * @param persistentObject object being persisted
079:             * @param columnIndex      column index in persistentObject
080:             * @throws SQLException
081:             * @see CallableStatement
082:             * @see DatabasePolicy
083:             * @see LobPostProcessings
084:             */
085:            void handleBind(PreparedStatement statement, int jdbcColIndex,
086:                    Object value, DatabasePolicy databasePolicy,
087:                    LobPostProcessings postProcessings,
088:                    PersistentObject persistentObject, int columnIndex)
089:                    throws SQLException;
090:
091:            /**
092:             * Defines how to extract OUT parameter from CallableStatement by parameter index
093:             *
094:             * @param statement      CallableStatement
095:             * @param parameterIndex 1-based out parameter index
096:             * @param databasePolicy database policy
097:             * @return out parameter value
098:             * @throws SQLException
099:             */
100:            Object handleOutParamRead(CallableStatement statement,
101:                    int parameterIndex, DatabasePolicy databasePolicy)
102:                    throws SQLException;
103:
104:            /**
105:             * Defines how to extract OUT parameter from CallableStatement by parameter name
106:             *
107:             * @param statement      CallableStatement
108:             * @param parameterName  the name of the parameter
109:             * @param databasePolicy database policy
110:             * @return out parameter value
111:             * @throws SQLException
112:             * @see CallableStatement
113:             * @see DatabasePolicy
114:             */
115:            Object handleOutParamRead(CallableStatement statement,
116:                    String parameterName, DatabasePolicy databasePolicy)
117:                    throws SQLException;
118:
119:            /**
120:             * Used for binding null values in PreparedStatement
121:             *
122:             * @param statement        PreparedStatement
123:             * @param parameterIndex   1-based binding index
124:             * @param columnType       column type
125:             * @param columnIdentifier string identifying the column. It is used in error message if bind fails
126:             */
127:            void handleBindNull(PreparedStatement statement,
128:                    int parameterIndex, ColumnType columnType,
129:                    String columnIdentifier) throws OdalPersistencyException;
130:
131:            /**
132:             * Returns true if update has to be done as 2-step bynary update:
133:             * 1st step - saving a minimal size byte array,
134:             * 2nd step - retrieving the binary object and update it through its stream
135:             *
136:             * @param databasePolicy
137:             * @return true if update has to be done as 2-step bynary update:
138:             *         1st step - saving a minimal size byte array,
139:             *         2nd step - retrieving the binary object and update it through its stream
140:             */
141:            boolean useTwoStepBinaryUpdate(DatabasePolicy databasePolicy);
142:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.