Source Code Cross Referenced for VcParamWhere.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas_ejb » genic » 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 » J2EE » JOnAS 4.8.6 » org.objectweb.jonas_ejb.genic 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * JOnAS: Java(TM) Open Application Server
003:         * Copyright (C) 1999-2004 Bull S.A.
004:         * Contact: jonas-team@objectweb.org
005:         *
006:         * This library is free software; you can redistribute it and/or
007:         * modify it under the terms of the GNU Lesser General Public
008:         * License as published by the Free Software Foundation; either
009:         * version 2.1 of the License, or any later version.
010:         *
011:         * This library is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         * Lesser General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU Lesser General Public
017:         * License along with this library; if not, write to the Free Software
018:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
019:         * USA
020:         *
021:         * --------------------------------------------------------------------------
022:         * $Id: VcParamWhere.java 5468 2004-09-21 14:28:46Z joaninh $
023:         * --------------------------------------------------------------------------
024:         */package org.objectweb.jonas_ejb.genic;
025:
026:        import org.objectweb.jonas_ejb.lib.JavaType;
027:
028:        /**
029:         * This class is the "Velocity context" for a parameter of a where clause of finder method for CMP1 only,
030:         * used in the Velocity Templates.
031:         * @author Helene Joanin : Initial developer
032:         */
033:        public class VcParamWhere {
034:
035:            /**
036:             * name of the parameter (ie "p1")
037:             */
038:            private String mName;
039:
040:            /**
041:             * type's name of the parameter
042:             */
043:            private String mTypeName;
044:
045:            /**
046:             * SQL type's name of the parameter
047:             */
048:            private String mSqlTypeName;
049:
050:            /**
051:             * SQL setter method name for this parameter
052:             */
053:            private String mSqlSetMethod;
054:
055:            /**
056:             * true if the parameter hasn't a java primitive type
057:             */
058:            private boolean hasNotPrimitiveType;
059:
060:            /**
061:             * true if the parameter has the java.math.BigInteger type
062:             */
063:            private boolean hasBigIntegerType;
064:
065:            /**
066:             * true if the parameter has a Serializable type
067:             */
068:            private boolean hasSerializableType;
069:
070:            /**
071:             * true if the parameter has a java.lang.* type except java.lang.string
072:             */
073:            private boolean hasJavaLangTypeExceptString;
074:
075:            /**
076:             * VcParamWhere Constructor
077:             * @param type parameter's type
078:             * @param position parameter's position in the where clause
079:             */
080:            VcParamWhere(Class type, int position) {
081:
082:                mName = new String("p" + position);
083:                mTypeName = JavaType.getName(type);
084:                mSqlTypeName = JavaType.getSQLType(type);
085:                mSqlSetMethod = JavaType.getSQLSetMethod(type);
086:                if (mSqlSetMethod == null) {
087:                    throw new Error(
088:                            "Cannot container persistence manage the type '"
089:                                    + type.getName() + "'");
090:                }
091:                hasNotPrimitiveType = !type.isPrimitive();
092:                hasBigIntegerType = type.equals(java.math.BigInteger.class);
093:                hasSerializableType = "setSerializable".equals(mSqlSetMethod);
094:                hasJavaLangTypeExceptString = false;
095:                if (type.getPackage() != null) {
096:                    if ("java.lang".equals(type.getPackage().getName())
097:                            && !java.lang.String.class.equals(type)) {
098:                        hasJavaLangTypeExceptString = true;
099:                    }
100:                }
101:
102:                // System.out.print("VcParamWhere: "+type.toString());
103:                // System.out.println(toString());
104:            }
105:
106:            /**
107:             * @return Returns the name of the parameter (ie "p1")
108:             */
109:            public String getName() {
110:                return mName;
111:            }
112:
113:            /**
114:             * @return Returns the type's name of the parameter
115:             */
116:            public String getTypeName() {
117:                return mTypeName;
118:            }
119:
120:            /**
121:             * @return Returns the SQL type's name of the parameter
122:             */
123:            public String getSqlTypeName() {
124:                return mSqlTypeName;
125:            }
126:
127:            /**
128:             * @return Returns the SQL setter method associated to the parameter
129:             */
130:            public String getSqlSetMethod() {
131:                return mSqlSetMethod;
132:            }
133:
134:            /**
135:             * @return Returns true if the parameter's type is not a java primitive type
136:             */
137:            public boolean hasNotPrimitiveType() {
138:                return hasNotPrimitiveType;
139:            }
140:
141:            /**
142:             * @return Returns true if the parameter's type is java.math.BigInteger
143:             */
144:            public boolean hasBigIntegerType() {
145:                return hasBigIntegerType;
146:            }
147:
148:            /**
149:             * @return Returns true if the parameter's type is Serializable
150:             */
151:            public boolean hasSerializableType() {
152:                return hasSerializableType;
153:            }
154:
155:            /**
156:             * @return true if the parameter's type is a java.lang.* type except java.lang.string
157:             */
158:            public boolean hasJavaLangTypeExceptString() {
159:                return hasJavaLangTypeExceptString;
160:            }
161:
162:            /**
163:             * @return Returns a string representation of the VcParamWhere object to debug use
164:             */
165:            public String toString() {
166:                StringBuffer ret = new StringBuffer();
167:                ret.append("\n    Name                 = " + getName());
168:                ret.append("\n    TypeName             = " + getTypeName());
169:                ret.append("\n    SqlTypeName          = " + getSqlTypeName());
170:                ret.append("\n    SqlSetMethod         = " + getSqlSetMethod());
171:                ret.append("\n    hasNotPrimitiveType  = "
172:                        + hasNotPrimitiveType());
173:                ret.append("\n    hasBigIntegerType    = "
174:                        + hasBigIntegerType());
175:                ret.append("\n    hasSerializableType  = "
176:                        + hasSerializableType());
177:                ret.append("\n    hasJavaLangTypeExceptString = "
178:                        + hasJavaLangTypeExceptString());
179:                return (ret.toString());
180:            }
181:
182:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.