-->
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.  [ 4 posts ] 
Author Message
 Post subject: One to many mapping file.hbm.xml
PostPosted: Mon Aug 28, 2006 7:40 am 
Newbie

Joined: Mon Aug 28, 2006 7:29 am
Posts: 2
Location: chennai
hi

i like to map the value of one table to three table in mysql. if i am using list ie., match Result is mapped to match info but the same value i needed in team info but it is not mapping on that situation. i am getting
org,hibernate.Generic JDBCExeption -cannot execute batch update. so please any one can know the solution for this please forward ur solution. if any misatke i have dont for the exception please forward it as soon as possible.



<?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 >
<class name="MatchResult" table="match_result">
<id name="id" column="id" type="int">
<generator class="increment"/>
</id>
<property name="matchid" type="int"/>
<property name="teamA" column="teamA" type="string"/>
<property name="teamB" column="teamB" type="string"/>
<property name="tossWinner" column="tossWinner" type="string"/>
<property name="tossDecision" column="tossDecision" type="string"/>
<list name="matchInfo" cascade="all">
<key column="parent_id"/>
<index column="idx"/>
<one-to-many class="MatchInfo"/>
</list>
<list name="teamInfo" cascade="all">
<key column="parent_id"/>
<index column="idx"/>
<one-to-many class="TeamInfo"/>
</list>

</class>
<class name="MatchInfo"
table="match_info">
<id name="id" unsaved-value="0">
<generator class="increment"/>
</id>
<property name="matchid" column="matchid" type="int"/>
<property name="teamA" column="teamA" type="string"/>

</class>

<class name="TeamInfo"
table="team_info">
<id name="id" unsaved-value="0">
<generator class="increment"/>
</id>
<property name="teamA" column="teamA" type="string"/>
<property name="teamB" column="teamB" type="string"/>
<property name="tossWinner" column="tossWinner" type="string"/>
<property name="tossDecision" column="tossDecision" type="string"/>

</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 28, 2006 12:54 pm 
Newbie

Joined: Mon Aug 28, 2006 12:13 pm
Posts: 4
Try setting hibernate.jdbc.batch_size=0


Top
 Profile  
 
 Post subject: Reg: one to many mapping
PostPosted: Tue Aug 29, 2006 1:01 am 
Newbie

Joined: Mon Aug 28, 2006 7:29 am
Posts: 2
Location: chennai
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update

i am getting same err while updating my hbm.xml. as i included the line


<property name="hibernate.jdbc.batch_size">10</property>



still now i am getting the error.

I am using the same table structure for mapping values.

please anybody knows inform me as soon as possible.


thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 29, 2006 3:22 am 
Newbie

Joined: Mon Aug 28, 2006 12:13 pm
Posts: 4
Please send full stack trace.
GeneicJDBCException is usualy wrapping some other plain JDBC exception.

What happened when you set batch_site to zero?

An please note, that not all jdbc drivers has good support for batch updates.
Batches is not a Hibernate feature. It is a JDBC feature, that Hibernate is trying to reuse. Your problem is probably jdbc driver or database vendor specific.

Anyway send more details.


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

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.