[Jboss-cvs] JBossAS SVN: r56167 - branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Aug 23 04:05:53 EDT 2006
Author: alex.loubyansky at jboss.com
Date: 2006-08-23 04:05:49 -0400 (Wed, 23 Aug 2006)
New Revision: 56167
Modified:
branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/EJBQLToSQL92Compiler.java
branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCEJBQLCompiler.java
branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/QueryParameter.java
Log:
JBAS-3541
Modified: branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/EJBQLToSQL92Compiler.java
===================================================================
--- branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/EJBQLToSQL92Compiler.java 2006-08-23 08:03:48 UTC (rev 56166)
+++ branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/EJBQLToSQL92Compiler.java 2006-08-23 08:05:49 UTC (rev 56167)
@@ -671,11 +671,7 @@
ASTParameter param = (ASTParameter) child0;
Class type = getParameterType(param.number);
- QueryParameter queryParam = new QueryParameter(param.number - 1,
- false, // isPrimaryKeyParameter
- null, // field
- null, // parameter
- typeFactory.getJDBCTypeForJavaType(type));
+ QueryParameter queryParam = new QueryParameter(param.number - 1, typeFactory.getJDBCType(type));
inputParameters.add(queryParam);
sql.append("? IS ");
@@ -1219,11 +1215,7 @@
"parameter node. Should have been handled at a higher level.");
}
- QueryParameter param = new QueryParameter(node.number - 1,
- false, // isPrimaryKeyParameter
- null, // field
- null, // parameter
- typeFactory.getJDBCTypeForJavaType(type));
+ QueryParameter param = new QueryParameter(node.number - 1, typeFactory.getJDBCType(type));
inputParameters.add(param);
buf.append('?');
Modified: branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCEJBQLCompiler.java
===================================================================
--- branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCEJBQLCompiler.java 2006-08-23 08:03:48 UTC (rev 56166)
+++ branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/JDBCEJBQLCompiler.java 2006-08-23 08:05:49 UTC (rev 56167)
@@ -1133,11 +1133,7 @@
ASTParameter param = (ASTParameter) child0;
Class type = getParameterType(param.number);
- QueryParameter queryParam = new QueryParameter(param.number - 1,
- false, // isPrimaryKeyParameter
- null, // field
- null, // parameter
- typeFactory.getJDBCTypeForJavaType(type));
+ QueryParameter queryParam = new QueryParameter(param.number - 1, typeFactory.getJDBCType(type));
inputParameters.add(queryParam);
buf.append("? IS ");
@@ -1677,11 +1673,7 @@
"parameter node. Should have been handled at a higher level.");
}
- QueryParameter param = new QueryParameter(node.number - 1,
- false, // isPrimaryKeyParameter
- null, // field
- null, // parameter
- typeFactory.getJDBCTypeForJavaType(type));
+ QueryParameter param = new QueryParameter(node.number - 1, typeFactory.getJDBCType(type));
inputParameters.add(param);
buf.append('?');
return buf;
Modified: branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/QueryParameter.java
===================================================================
--- branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/QueryParameter.java 2006-08-23 08:03:48 UTC (rev 56166)
+++ branches/Branch_3_2/server/src/main/org/jboss/ejb/plugins/cmp/jdbc/QueryParameter.java 2006-08-23 08:05:49 UTC (rev 56167)
@@ -1,24 +1,24 @@
/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
package org.jboss.ejb.plugins.cmp.jdbc;
import java.lang.reflect.Method;
@@ -62,13 +62,7 @@
}
else
{
- QueryParameter param = new QueryParameter(
- argNum,
- false,
- null,
- null,
- type.getJDBCTypes()[0]);
- param.type = type;
+ QueryParameter param = new QueryParameter(argNum, type);
parameters = Collections.singletonList(param);
}
return parameters;
@@ -155,7 +149,7 @@
private final boolean isPrimaryKeyParameter;
private JDBCFieldBridge field;
private JDBCTypeComplexProperty property;
- private final String parameterString;
+ private String parameterString;
private int jdbcType;
private JDBCType type;
@@ -259,6 +253,15 @@
}
}
+ public QueryParameter(int argNum, JDBCType type)
+ {
+ this.argNum = argNum;
+ this.type = type;
+ this.jdbcType = type.getJDBCTypes()[0];
+ this.isPrimaryKeyParameter = false;
+ initToString();
+ }
+
public QueryParameter(
int argNum,
boolean isPrimaryKeyParameter,
@@ -273,6 +276,11 @@
this.property = property;
this.jdbcType = jdbcType;
+ initToString();
+ }
+
+ private void initToString()
+ {
StringBuffer parameterBuf = new StringBuffer();
parameterBuf.append(argNum);
if(field != null)
More information about the jboss-cvs-commits
mailing list