1 Reply Latest reply on Oct 19, 2005 5:21 AM by a.gerhard

    BigInteger in finder query (eql, cmp)

    a.gerhard

      Hi JBoss-Developers,

      I have a little problem. I changed my primary keys from long to BigInteger, because I use a new ID-generator. Everything is all right, but the finder querys crashes with the following exception:

      java.sql.SQLException: ERROR: operator does not exist: numeric = bytea

      Relations between tables are no problem (1..n), I defined the primary and the foreign key as (SQL-TYPE=NUMERIC(38), JDBC-TYPE=NUMERIC).

      Any sugestions?

      Thank you.

        • 1. Re: BigInteger in finder query (eql, cmp)
          a.gerhard

          Hello Andreas,

          it's quite simple.

          Search the mapping of your database int the configurationfile standardjbosscmp-jdbc.xml (PostgreSQL 8.0, for example). Then add into the <type-mapping>-section the following lines:

           <mapping>
           <java-type>java.math.BigInteger</java-type>
           <jdbc-type>NUMERIC</jdbc-type>
           <sql-type>NUMERIC</sql-type>
           </mapping>
          


          That's all.

          Greetings,

          Andreas