-->
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: JPA Problem
PostPosted: Mon Jul 26, 2010 5:54 am 
Newbie

Joined: Sun Aug 09, 2009 12:14 pm
Posts: 16
I have Company_Contacts with PK contain two objects Company and Users.
When i insert new company_contact row i use company_id and user_id which i get as parameter from my jsp form.
Then i want to show a whole list of my company_contacts, but the inserted line those not retrieves as i expect, i have some missing data.

i tried to debug and i realize that when i retrieve the list i get the same Company_Contacts_PK that was just inserted which is not fine.
it seems that the last object that i insert is saved in a place on the cache and not initialized from the DB as it should.


Code:
companyContactsDao.insertNewContact(companyContact s);

companyContactsList=companyContactsDao.getCompanyC ontacts(companyContacts.getCompanyContactsPK().get Company().getCmp_company_id());


actually companyContacts is not the same object but the PK class is the same on the memory.

Any Help


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.