-->
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: IllegalAddException
PostPosted: Wed May 14, 2008 1:41 am 
Newbie

Joined: Mon May 12, 2008 2:49 am
Posts: 3
I am trying to retrieve the datas from database in the XML format. i could manage doing it, If i have only one record in my Table. If i add another record in my table and do the same i am getting the "IllegalAddException". Please help out on this issue.

I have attached my config.xml and mapping xml.

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="com.class">
<class name="Insurance" table="INSURANCE1">
<id name="policyNo" type="long" column="POLICYNO" >
<generator class="assigned"/>
</id>

<property name="policyName">
<column name="POLICYNAME" />
</property>
<property name="companyName">
<column name="COMPANYNAME"/>
</property>
<property name="insuredName">
<column name="INSUREDNAME"/>
</property>
</class>
</hibernate-mapping>



<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.ibm.db2.jcc.DB2Driver</property>
<property name="hibernate.connection.url">jdbc:db2://XXX/SAMPLE</property>
<property name="hibernate.connection.username">fdg</property>
<property name="hibernate.connection.password">dfgdf</property>
<property name="hibernate.connection.pool_size">10</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.DB2Dialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- Mapping files -->
<mapping resource="Insurance.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Any help is appreciated.

_________________
Regards,
Mani


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.