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
|
|