This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate - How to save multiple entities in single transactions

 
Bala Gangadhar
Ranch Hand
Posts: 104
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Thanks for your replies. One more question on Hibernate mapping..

I have a Class, TestClass with fields
field1
field2....
....
...filed6.

I have mapped this class to two tables with two differnt entity names

<class name="com.something.TestClass " table="TEST_TABLE" entity-name="TestTableTestClass">
<id name="filed1" column="FIELD1" />
<property name="filed2" column="FIELD2" />
<property name="filed5" column="FIELD5" />

</class>
and some fileds to second table with different entity name
<class name="com.something.TestClass " table="TEST_TABLE_OTHER" entity-name="TestTableOtherTestClass">
<id name="filed2" column="FIELD2" />
<property name="filed4" column="FIELD4" />
<property name="filed5" column="FIELD5" />

</class>

Now my requirement is save entries to both the tables in single transaction,



But unfotunately its saving only the first save. i.e TestTableTestClass enitity to corresponding table. If change the order then also only first save is working and second is not.

Neither its throwing any error.... Not sure whats the error.

Can somebody help me....
 
Bala Gangadhar
Ranch Hand
Posts: 104
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, did i post this in wrong forum ? Shouldn't it be under Object relational Mapping
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic