-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Character to numeric conversion error on java.lang.Double
PostPosted: Thu Jun 16, 2005 5:35 am 
Beginner
Beginner

Joined: Thu Apr 29, 2004 4:03 pm
Posts: 40
Hi,
I have a quite simple configuration (and problem):
In the POJO object (InputTransactionLNC.java) there are java.lang.Double types. I'm using Informix database, where the attributes in table aro of FLOAT types.
When I try to save an instance, where these Double are filled,
I got an Char to numeric SQLException (see below).

I tried to map the double attribute to java.lang.Double/didn't specify the type, but neither of those works (ends up with exception).

any ideas? thank you


Hibernate version: 2.1.8

Mapping documents:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
<hibernate-mapping package="cz.aura.isl.katalog.davky.domain.transaction.ldics">

<class name="InputTransactionLNC" table="kdiclnc" polymorphism="explicit">

<id
name="DCN"
type="java.lang.String"
column="kdcn">
<generator class="assigned"/>
</id>

<property
name="trida"
column="ktrida"
type="java.lang.String" />

<property
name="skupina"
column="kskup"
type="java.lang.String" />

<property
name="idNazvuH6"
column="id_kcch6"
type="java.lang.Integer"/>

<property
name="idPolozkyKatalogu"
column="id_kpolkat"
type="java.lang.Integer"/>

<property name="id_kcprumt"
column="id_kcprumt"
type="java.lang.Integer"/>

<property name="i_kmjedn"
column="i_kmjedn"
type="java.lang.String"/>

<property name="j_kmjedn"
column="j_kmjedn"
type="java.lang.String"/>

<property name="k_kmjedn"
column="k_kmjedn"
type="java.lang.String"/>

<property name="m_kmjedn"
column="m_kmjedn"
type="java.lang.String"/>


<!-- Segment H mapovani -->

<property name="UIC"
column="l_kmjedn"
type="java.lang.String"/>

<property name="SOSMC"
column="sosmc"
type="java.lang.String"/>

<property name="ADPEIC"
column="adpeic"
type="java.lang.String"/>

<property name="NATOCurCode"
column="kmeny"
type="java.lang.String"/>

<property name="unitPrice"
column="cena"
type="java.math.BigDecimal"/>

<property name="PMIC"
column="pmic"
type="java.lang.String"/>

<property name="AAC"
column="aac"
type="java.lang.String"/>

<!--Segment H druhy stitek -->
<property name="CIIC"
column="cicc"
type="java.lang.String"/>

<property name="QUPC"
column="qupc"
type="java.lang.String"/>

<property name="shelfLifeCode"
column="kodziv"
type="java.lang.String"/>

<property name="NATOREC"
column="narec"
type="java.lang.String"/>

<property name="USIServCode"
column="usi"
type="java.lang.String"/>

<property name="objem"
column="objem"
/>

<property name="vyska"
column="vyska"
/>

<property name="sirka"
column="sirka"
/>

<property name="delka"
column="delka"
/>

<property name="kangnaz"
column="kangnaz"
type="java.lang.String"/>

<property name="kprfak"
column="kprfak"
type="java.math.BigDecimal"/>

<property name="hmotnostNaplne"
column="hmnapl"
/>

<property name="hmotnostVybusniny"
column="hmvybu"
/>

<property name="netto"
column="netto"
/>

<property name="brutto"
column="brutto"
/>

<property name="kdvzt"
column="kdvzt"
type="java.util.Date"/>

<property name="fileName"
column="knsoub"
type="java.lang.String"/>

<property name="naz"
column="naz"
type="java.lang.String"/>


<property name="DMLC"
column="dmlc"
type="java.lang.String"/>

<property name="IIG"
column="kiig"
type="java.lang.String"/>

<property name="itemName"
column="knazmat"
type="java.lang.String"/>

<property name="RPDMRC"
column="rpdmrc"
type="java.lang.String"/>

<property name="TIIC"
column="tidpol"
type="java.lang.String"/>

<property
name="MOECode"
column="kmoeext"
type="java.lang.String"/>

<property
name="MOEInt"
column="kmoeint"
type="java.lang.String"/>
<property
name="kkstdic"
column="kkstdic"
type="java.lang.String"
not-null="true"
length="1"/>


<bag name="klnccs" cascade="all" inverse="true">
<key column="kdcn"/>
<!--
<index>
<column name="id_klncc"></column>
</index> -->
<one-to-many class="InputTransactionLNC$Klncc" />
</bag>

<bag name="klncvs" cascade="all" inverse="false">
<key column="kdcn"/>
<!--<index>
<column name="id_klncv"></column>
</index> -->
<one-to-many class="InputTransactionLNC$Klncv" />
</bag>

<!-- Namapovani atributu definice nazvu -->
<one-to-one class="InputTransactionLNC$Kdnazlnc" name="itemNameDefinitionData" cascade="delete"></one-to-one>
</class>

<class name="InputTransactionLNC$Klncc" table="klncc" polymorphism="explicit">
<id
name="id"
type="java.lang.Integer"
column="id_klncc"
unsaved-value="-1"
>

<generator class="native"/>
</id>

<property
name="RNCC"
column="rncc"
type="java.lang.String"/>


<property
name="RNVC"
column="rnvc"
type="java.lang.String"/>

<property
name="DAC"
column="dac"
type="java.lang.String"/>

<property
name="RNJC"
column="rnjc"
type="java.lang.String"/>

<property
name="RNFC"
column="rnfc"
type="java.lang.String"/>

<property
name="RNSC"
column="rnsc"
type="java.lang.String"/>

<property
name="DCN"
column="kdcn"
type="java.lang.String"/>

<property
name="MOECode"
column="kmoeext"
type="java.lang.String"/>

<property
name="MOEInt"
column="kmoeint"
type="java.lang.String"/>

<property
name="RN"
column="rn"
type="java.lang.String"/>

<property
name="puvnazc"
column="puvnazc"
type="java.lang.String"/>

<property
name="idOrganizace"
column="id_kcorg"
type="java.lang.Integer"/>



</class>

<class name="InputTransactionLNC$Klncv" table="klncv" polymorphism="explicit">
<id
name="id"
type="java.lang.Integer"
column="id_klncv"
unsaved-value="-1"
>
<generator class="native"/>
</id>

<property
name="kdcn"
column="kdcn"
type="java.lang.String"/>

<property
name="kkodp"
column="kkodp"
type="java.lang.String"/>

</class>


<class name="InputTransactionLNC$Kdnazlnc" table="kdnazlnc" polymorphism="explicit" >
<id unsaved-value="null"
name="DCN"
type="java.lang.String"
column="kdcn" >
<generator class="assigned">
</generator>
</id>

<property
name="itemNameDefinition"
column="kdefnlnc"
type="java.lang.String"/>

</class>
</hibernate-mapping>




Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
SEVERE: Could not synchronize database state with session
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not insert: [cz.aura.isl.katalog.davky.domain.transaction.ldics.InputTransactionLNC#WSWZ0419133333332]: encountered SQLException [Character to numeric conversion error]; nested exception is java.sql.SQLException: Character to numeric conversion error
java.sql.SQLException: Character to numeric conversion error
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:355)

onTearDown: cz.aura.isl.katalog.dao.impl.InputTransactionLNCDAOImplTest
tearDown: cz.aura.isl.katalog.davky.AuraFastDatabaseTestCase
at com.informix.jdbc.IfxSqli.addException(IfxSqli.java:3086)
at com.informix.jdbc.IfxSqli.receiveError(IfxSqli.java:3396)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2259)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2179)
at com.informix.jdbc.IfxSqli.executeCommand(IfxSqli.java:721)
at com.informix.jdbc.IfxResultSet.executeUpdate(IfxResultSet.java:305)
at com.informix.jdbc.IfxStatement.executeUpdateImpl(IfxStatement.java:882)
at c



Name and version of the database you are using:
Informix (version don't know)


The generated SQL (show_sql=true):
INFO: Not binding factory to JNDI, no JNDI name configured
Hibernate: insert into kdiclnc (ktrida, kskup, id_kcch6, id_kpolkat, id_kcprumt, i_kmjedn, j_kmjedn, k_kmjedn, m_kmjedn, l_kmjedn, sosmc, adpeic, kmeny, cena, pmic, aac, cicc, qupc, kodziv, narec, usi, objem, vyska, sirka, delka, kangnaz, kprfak, hmnapl, hmvybu, netto, brutto, kdvzt, knsoub, naz, dmlc, kiig, knazmat, rpdmrc, tidpol, kmoeext, kmoeint, kkstdic, kdcn) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
16.6.2005 11:26:07 net.sf.hibernate.util.JDBCExceptionReporter logExceptions





Debug level Hibernate log excerpt:



Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.