-->
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.  [ 3 posts ] 
Author Message
 Post subject: Only Primary key being persisted
PostPosted: Wed Aug 05, 2009 6:09 am 
Newbie

Joined: Wed Aug 05, 2009 5:41 am
Posts: 3
Hi All,

When I set all the attributes of an entity and persist it, only primary keys are seen in the database. The primary key is generated using the SequenceGenerator annotation.


part of the code is:

Service:

Code:
FileIndividualUser user = new FileIndividualUser();
user.setDrmPolicy(policy);
user.setFile(file);
user.setUser(users);
FileIndividualUserId fiuId = new FileIndividualUserId(newId, iUid, iFullRightsPolicyId); // EmbeddeId
user.setId(fiuId);
publishServiceDao.persistObjects(user);


DAO:

Code:
@Transactional
public void persistObjects(Object obj) {
      em.persist(obj);
}


Please guide.


Top
 Profile  
 
 Post subject: Re: Only Primary key being persisted
PostPosted: Mon Aug 10, 2009 7:11 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Make sure you are committing the transaction.

When do the keys appear? Do they remain there when the program has finished running, but with no other data?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject: Re: Only Primary key being persisted
PostPosted: Tue Aug 11, 2009 1:04 am 
Newbie

Joined: Wed Aug 05, 2009 5:41 am
Posts: 3
Those appear after the program finishes.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.