-->
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: Our code that uses hibernate inserts 2 rows in the database:
PostPosted: Mon Sep 15, 2008 9:52 am 
Newbie

Joined: Mon Sep 15, 2008 9:47 am
Posts: 1
Hibernate Version: Hibernate Tools 3.2.0.beta8
Code uses: Spring Framework.

Hi,

Our code is inserting 2 rows in the table. Our code is using hibernate to do so.
Here are our tables’ structures:

We have 3 tables: Organizations, Customers and AdPackages.
Organizations and Customers associated with Organization_Id.
Customers and AdPackages associated with Customer_Id.

adPackage = new AdPackages();
adPackage.setCancelled('N');
adPackage.setDbLock('N');
adPackage.setEdrDatasourceName("DAT");
adPackage.setDatasourceDesc("Data Admin Tool");

Customers cust = new Customers();
cust.setActive('Y');
cust.setCreateDate(new Date());
cust.setCreateDbUser(applicationData.getDB_USER_NAME());
cust.setOrganizations(org); // where org is Organizations instance

cust.getAdPackageses().add(adPackage);//where adPackage is AdPackage instance
adPackage.setCustomers(cust);


Now, we have question because above code working different way in 2 files.
In one file it is creating single row for AdPackages and in other file same code is creating 2 rows for AdPackages.

Do you have any idea about this problem?

Please let us know.


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.