[Jboss-cvs] JBossAS SVN: r56172 - in branches/JBoss_4_0_4_GA_JBAS-3552/testsuite: imports/sections src/main/org/jboss/test/cmp2 src/main/org/jboss/test/cmp2/jbas3541 src/resources/cmp2 src/resources/cmp2/jbas3541 src/resources/cmp2/jbas3541/META-INF

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Aug 23 06:11:30 EDT 2006


Author: alex.loubyansky at jboss.com
Date: 2006-08-23 06:11:23 -0400 (Wed, 23 Aug 2006)
New Revision: 56172

Added:
   branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/
   branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/ABean.java
   branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/ALocal.java
   branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/ALocalHome.java
   branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/IntJDBCAdaptor.java
   branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/JBAS3541UnitTestCase.java
   branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/resources/cmp2/jbas3541/
   branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/resources/cmp2/jbas3541/META-INF/
   branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/resources/cmp2/jbas3541/META-INF/ejb-jar.xml
   branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/resources/cmp2/jbas3541/META-INF/jboss.xml
   branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/resources/cmp2/jbas3541/META-INF/jbosscmp-jdbc.xml
Modified:
   branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/imports/sections/cmp.xml
Log:
the testcase

Modified: branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/imports/sections/cmp.xml
===================================================================
--- branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/imports/sections/cmp.xml	2006-08-23 08:34:57 UTC (rev 56171)
+++ branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/imports/sections/cmp.xml	2006-08-23 10:11:23 UTC (rev 56172)
@@ -310,6 +310,19 @@
             includes="junit/**/*.*"/>
       </jar>
 
+      <!-- build cmp2-jbas3541.jar -->
+      <jar destfile="${build.lib}/cmp2-jbas3541.jar">
+         <fileset dir="${build.classes}">
+            <patternset refid="jboss.test.util.ejb.set"/>
+            <include name="org/jboss/test/cmp2/jbas3541/**"/>
+         </fileset>
+         <fileset dir="${build.resources}/cmp2/jbas3541">
+            <include name="**/*.*"/>
+         </fileset>
+         <zipfileset src="${junit.junit.lib}/junit.jar"
+            includes="junit/**/*.*"/>
+      </jar>
+
       <!-- build cmp2-jbas979.jar -->
       <jar destfile="${build.lib}/cmp2-jbas979.jar">
          <fileset dir="${build.classes}">

Added: branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/ABean.java
===================================================================
--- branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/ABean.java	2006-08-23 08:34:57 UTC (rev 56171)
+++ branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/ABean.java	2006-08-23 10:11:23 UTC (rev 56172)
@@ -0,0 +1,101 @@
+/*
+  * 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.test.cmp2.jbas3541;
+
+
+import javax.ejb.EntityBean;
+import javax.ejb.EntityContext;
+import javax.ejb.RemoveException;
+import javax.ejb.CreateException;
+
+
+/**
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @version <tt>$Revision: $</tt>
+ */
+public abstract class ABean implements EntityBean
+{
+   // CMP accessors --------------------------------------------
+   /**
+    * @ejb.pk-field
+    * @ejb.persistent-field
+    * @ejb.interface-method
+    */
+   public abstract Long getId();
+
+   public abstract void setId(Long id);
+
+   /**
+    * @ejb.persistent-field
+    * @ejb.interface-method
+    */
+   public abstract Integer getIntField();
+
+  /**
+   * @ejb.interface-method
+   */
+   public abstract void setIntField(Integer i);
+
+   /**
+    * @throws javax.ejb.CreateException
+    * @ejb.create-method
+    */
+   public Long ejbCreate(Long id, Integer i)
+      throws CreateException
+   {
+      setId(id);
+      setIntField(i);
+      return null;
+   }
+
+   public void ejbPostCreate(Long id, Integer i)
+   {
+   }
+
+   public void setEntityContext(EntityContext ctx)
+   {
+   }
+
+   public void unsetEntityContext()
+   {
+   }
+
+   public void ejbActivate()
+   {
+   }
+
+   public void ejbLoad()
+   {
+   }
+
+   public void ejbPassivate()
+   {
+   }
+
+   public void ejbRemove() throws RemoveException
+   {
+   }
+
+   public void ejbStore()
+   {
+   }
+}

Added: branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/ALocal.java
===================================================================
--- branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/ALocal.java	2006-08-23 08:34:57 UTC (rev 56171)
+++ branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/ALocal.java	2006-08-23 10:11:23 UTC (rev 56172)
@@ -0,0 +1,36 @@
+/*
+  * 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.test.cmp2.jbas3541;
+
+/**
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @version <tt>$Revision: $</tt>
+ */
+public interface ALocal
+   extends javax.ejb.EJBLocalObject
+{
+   public Long getId(  ) ;
+
+   public Integer getIntField(  ) ;
+
+   public void setIntField( Integer i ) ;
+}

Added: branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/ALocalHome.java
===================================================================
--- branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/ALocalHome.java	2006-08-23 08:34:57 UTC (rev 56171)
+++ branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/ALocalHome.java	2006-08-23 10:11:23 UTC (rev 56172)
@@ -0,0 +1,41 @@
+/*
+  * 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.test.cmp2.jbas3541;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @version <tt>$Revision: $</tt>
+ */
+public interface ALocalHome
+   extends javax.ejb.EJBLocalHome
+{
+   public ALocal create(Long id , Integer i)
+      throws javax.ejb.CreateException;
+
+   public ALocal findByPrimaryKey(Long pk)
+      throws javax.ejb.FinderException;
+
+   public Collection findByIntField(int i)
+      throws javax.ejb.FinderException;
+}

Added: branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/IntJDBCAdaptor.java
===================================================================
--- branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/IntJDBCAdaptor.java	2006-08-23 08:34:57 UTC (rev 56171)
+++ branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/IntJDBCAdaptor.java	2006-08-23 10:11:23 UTC (rev 56172)
@@ -0,0 +1,54 @@
+/*
+  * 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.test.cmp2.jbas3541;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+import java.sql.ResultSet;
+import org.jboss.ejb.plugins.cmp.jdbc.JDBCParameterSetter;
+import org.jboss.ejb.plugins.cmp.jdbc.JDBCResultSetReader;
+import org.jboss.logging.Logger;
+
+/**
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @version <tt>$Revision: $</tt>
+ */
+public class IntJDBCAdaptor
+   implements JDBCParameterSetter, JDBCResultSetReader
+{
+   public void set(PreparedStatement ps, int index, int jdbcType, Object value, Logger log) throws SQLException
+   {
+      if(value == null)
+      {
+         ps.setNull(index, jdbcType);
+      }
+      else
+      {
+         ps.setInt(index, 2);
+      }
+   }
+
+   public Object get(ResultSet rs, int index, Class destination, Logger log) throws SQLException
+   {
+      return rs.wasNull() ? null : new Integer(rs.getInt(index));
+   }
+}

Added: branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/JBAS3541UnitTestCase.java
===================================================================
--- branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/JBAS3541UnitTestCase.java	2006-08-23 08:34:57 UTC (rev 56171)
+++ branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/main/org/jboss/test/cmp2/jbas3541/JBAS3541UnitTestCase.java	2006-08-23 10:11:23 UTC (rev 56172)
@@ -0,0 +1,81 @@
+/*
+  * 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.test.cmp2.jbas3541;
+
+import java.util.Iterator;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import org.jboss.test.JBossTestCase;
+import org.jboss.test.util.ejb.EJBTestCase;
+import junit.framework.Test;
+
+/**
+ * @author <a href="mailto:alex at jboss.org">Alexey Loubyansky</a>
+ * @version <tt>$Revision: 44174 $</tt>
+ */
+public class JBAS3541UnitTestCase
+   extends EJBTestCase
+{
+   public static Test suite() throws Exception
+   {
+      return JBossTestCase.getDeploySetup(JBAS3541UnitTestCase.class, "cmp2-jbas3541.jar");
+   }
+
+   public JBAS3541UnitTestCase(String methodName)
+   {
+      super(methodName);
+   }
+
+   protected void setUp() throws Exception
+   {
+      getALocalHome().create(new Long(1), new Integer(2));
+   }
+
+   protected void tearDown() throws Exception
+   {
+      getALocalHome().remove(new Long(1));
+   }
+
+   // Tests
+
+   public void testJBAS3541() throws Throwable
+   {
+      Iterator all = getALocalHome().findByIntField(100000).iterator();
+      assertTrue(all.hasNext());
+      ALocal a = (ALocal)all.next();
+      assertEquals(new Integer(2), a.getIntField());
+   }
+
+   // Private
+
+   private ALocalHome getALocalHome()
+      throws NamingException
+   {
+      return (ALocalHome)lookup("ALocal");
+   }
+
+   private Object lookup(String name) throws NamingException
+   {
+      InitialContext ic = new InitialContext();
+      return ic.lookup(name);
+   }
+}

Added: branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/resources/cmp2/jbas3541/META-INF/ejb-jar.xml
===================================================================
--- branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/resources/cmp2/jbas3541/META-INF/ejb-jar.xml	2006-08-23 08:34:57 UTC (rev 56171)
+++ branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/resources/cmp2/jbas3541/META-INF/ejb-jar.xml	2006-08-23 10:11:23 UTC (rev 56172)
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<!DOCTYPE ejb-jar PUBLIC
+   "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
+   "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
+
+<ejb-jar>
+   <enterprise-beans>
+      <session>
+         <description>JUnit Session Bean Test Runner</description>
+         <ejb-name>EJBTestRunnerEJB</ejb-name>
+         <home>org.jboss.test.util.ejb.EJBTestRunnerHome</home>
+         <remote>org.jboss.test.util.ejb.EJBTestRunner</remote>
+         <ejb-class>org.jboss.test.util.ejb.EJBTestRunnerBean</ejb-class>
+         <session-type>Stateless</session-type>
+         <transaction-type>Bean</transaction-type>
+      </session>
+      <entity >
+         <ejb-name>A</ejb-name>
+
+         <local-home>org.jboss.test.cmp2.jbas3541.ALocalHome</local-home>
+         <local>org.jboss.test.cmp2.jbas3541.ALocal</local>
+
+         <ejb-class>org.jboss.test.cmp2.jbas3541.ABean</ejb-class>
+         <persistence-type>Container</persistence-type>
+         <prim-key-class>java.lang.Long</prim-key-class>
+         <reentrant>false</reentrant>
+         <cmp-version>2.x</cmp-version>
+         <abstract-schema-name>A</abstract-schema-name>
+         <cmp-field >
+            <description><![CDATA[]]></description>
+            <field-name>id</field-name>
+         </cmp-field>
+         <cmp-field >
+            <description><![CDATA[]]></description>
+            <field-name>intField</field-name>
+         </cmp-field>
+         <primkey-field>id</primkey-field>
+
+         <query>
+            <query-method>
+               <method-name>findByIntField</method-name>
+               <method-params>
+                  <method-param>int</method-param>
+               </method-params>
+            </query-method>
+            <ejb-ql><![CDATA[select object(o) from A o where o.intField=?1]]></ejb-ql>
+         </query>
+      </entity>
+   </enterprise-beans>
+</ejb-jar>

Added: branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/resources/cmp2/jbas3541/META-INF/jboss.xml
===================================================================
--- branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/resources/cmp2/jbas3541/META-INF/jboss.xml	2006-08-23 08:34:57 UTC (rev 56171)
+++ branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/resources/cmp2/jbas3541/META-INF/jboss.xml	2006-08-23 10:11:23 UTC (rev 56172)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<jboss>
+   <enterprise-beans>
+      <entity>
+         <ejb-name>A</ejb-name>
+         <local-jndi-name>ALocal</local-jndi-name>
+      </entity>
+      <session>
+         <ejb-name>EJBTestRunnerEJB</ejb-name>
+         <jndi-name>ejb/EJBTestRunner</jndi-name>
+      </session>
+   </enterprise-beans>
+</jboss>

Added: branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/resources/cmp2/jbas3541/META-INF/jbosscmp-jdbc.xml
===================================================================
--- branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/resources/cmp2/jbas3541/META-INF/jbosscmp-jdbc.xml	2006-08-23 08:34:57 UTC (rev 56171)
+++ branches/JBoss_4_0_4_GA_JBAS-3552/testsuite/src/resources/cmp2/jbas3541/META-INF/jbosscmp-jdbc.xml	2006-08-23 10:11:23 UTC (rev 56172)
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE jbosscmp-jdbc PUBLIC
+   "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN"
+   "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">
+<jbosscmp-jdbc>
+   <defaults>
+      <remove-table>true</remove-table>
+   </defaults>
+   <enterprise-beans>
+      <entity>
+         <ejb-name>A</ejb-name>
+         <datasource>java:/DefaultDS</datasource>
+         <datasource-mapping>Custom Hypersonic SQL</datasource-mapping>
+         <query>
+            <query-method>
+               <method-name>findByIntField</method-name>
+               <method-params>
+                  <method-param>int</method-param>
+               </method-params>
+            </query-method>
+            <jboss-ql><![CDATA[select object(o) from A o where o.intField=?1]]></jboss-ql>
+         </query>
+      </entity>
+   </enterprise-beans>
+
+   <type-mappings>
+      <type-mapping>
+         <name>Custom Hypersonic SQL</name>
+         <row-locking-template/>
+         <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template>
+         <fk-constraint-template>ALTER TABLE ?1 ADD CONSTRAINT ?2 FOREIGN KEY (?3) REFERENCES ?4 (?5)</fk-constraint-template>
+         <auto-increment-template>?1 IDENTITY</auto-increment-template>
+         <add-column-template>ALTER TABLE ?1 ADD COLUMN ?2 ?3</add-column-template>
+         <drop-column-template>ALTER TABLE ?1 DROP COLUMN ?2</drop-column-template>
+         <alias-header-prefix>t</alias-header-prefix>
+         <alias-header-suffix>_</alias-header-suffix>
+         <alias-max-length>32</alias-max-length>
+         <subquery-supported>true</subquery-supported>
+         <true-mapping>(1=1)</true-mapping>
+         <false-mapping>(1=0)</false-mapping>
+
+         <function-mapping>
+            <function-name>concat</function-name>
+            <function-sql>(?1 || ?2)</function-sql>
+         </function-mapping>
+         <function-mapping>
+            <function-name>substring</function-name>
+            <function-sql>SUBSTRING(?1, ?2, ?3)</function-sql>
+         </function-mapping>
+         <function-mapping>
+            <function-name>lcase</function-name>
+            <function-sql>lcase(?1)</function-sql>
+         </function-mapping>
+         <function-mapping>
+            <function-name>length</function-name>
+            <function-sql>LENGTH(?1)</function-sql>
+         </function-mapping>
+         <function-mapping>
+            <function-name>locate</function-name>
+            <function-sql>LOCATE(?1, ?2, ?3)</function-sql>
+         </function-mapping>
+         <function-mapping>
+            <function-name>abs</function-name>
+            <function-sql>ABS(?1)</function-sql>
+         </function-mapping>
+         <function-mapping>
+            <function-name>sqrt</function-name>
+            <function-sql>SQRT(?1)</function-sql>
+         </function-mapping>
+         <function-mapping>
+            <function-name>ucase</function-name>
+            <function-sql>ucase(?1)</function-sql>
+         </function-mapping>
+         <function-mapping>
+            <function-name>count</function-name>
+            <function-sql>count(?1)</function-sql>
+         </function-mapping>
+
+         <mapping>
+            <java-type>java.lang.Byte</java-type>
+            <jdbc-type>SMALLINT</jdbc-type>
+            <sql-type>SMALLINT</sql-type>
+         </mapping>
+         <mapping>
+            <java-type>java.util.Date</java-type>
+            <jdbc-type>TIMESTAMP</jdbc-type>
+            <sql-type>TIMESTAMP</sql-type>
+         </mapping>
+         <mapping>
+            <java-type>java.lang.Boolean</java-type>
+            <jdbc-type>BIT</jdbc-type>
+            <sql-type>BIT</sql-type>
+         </mapping>
+         <mapping>
+            <java-type>java.lang.Integer</java-type>
+            <jdbc-type>INTEGER</jdbc-type>
+            <sql-type>INTEGER</sql-type>
+            <param-setter>org.jboss.test.cmp2.jbas3541.IntJDBCAdaptor</param-setter>
+            <result-reader>org.jboss.test.cmp2.jbas3541.IntJDBCAdaptor</result-reader>
+         </mapping>
+         <mapping>
+            <java-type>java.lang.Object</java-type>
+            <!-- hsqldb only supports directly serializable objects for sql type OBJECT -->
+            <jdbc-type>VARBINARY</jdbc-type>
+            <sql-type>VARBINARY</sql-type>
+         </mapping>
+         <mapping>
+            <java-type>java.lang.Short</java-type>
+            <jdbc-type>SMALLINT</jdbc-type>
+            <sql-type>SMALLINT</sql-type>
+         </mapping>
+         <mapping>
+            <java-type>java.lang.Character</java-type>
+            <jdbc-type>CHAR</jdbc-type>
+            <sql-type>CHAR</sql-type>
+         </mapping>
+         <mapping>
+            <java-type>java.lang.String</java-type>
+            <jdbc-type>VARCHAR</jdbc-type>
+            <sql-type>VARCHAR(256)</sql-type>
+         </mapping>
+         <mapping>
+            <java-type>java.sql.Date</java-type>
+            <jdbc-type>DATE</jdbc-type>
+            <sql-type>DATE</sql-type>
+         </mapping>
+         <mapping>
+            <java-type>java.sql.Time</java-type>
+            <jdbc-type>TIME</jdbc-type>
+            <sql-type>TIME</sql-type>
+         </mapping>
+         <mapping>
+            <java-type>java.sql.Timestamp</java-type>
+            <jdbc-type>TIMESTAMP</jdbc-type>
+            <sql-type>TIMESTAMP</sql-type>
+         </mapping>
+         <mapping>
+            <java-type>java.lang.Float</java-type>
+            <jdbc-type>REAL</jdbc-type>
+            <sql-type>REAL</sql-type>
+         </mapping>
+         <mapping>
+            <java-type>java.lang.Long</java-type>
+            <jdbc-type>BIGINT</jdbc-type>
+            <sql-type>BIGINT</sql-type>
+         </mapping>
+         <mapping>
+            <java-type>java.lang.Double</java-type>
+            <jdbc-type>DOUBLE</jdbc-type>
+            <sql-type>DOUBLE</sql-type>
+         </mapping>
+         <mapping>
+            <java-type>java.math.BigDecimal</java-type>
+            <jdbc-type>DECIMAL</jdbc-type>
+            <sql-type>DECIMAL</sql-type>
+         </mapping>
+      </type-mapping>
+   </type-mappings>
+</jbosscmp-jdbc>




More information about the jboss-cvs-commits mailing list