-->
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: Merge does not update collections
PostPosted: Tue Feb 19, 2008 9:18 am 
Newbie

Joined: Tue Feb 19, 2008 8:51 am
Posts: 2
Hi everyone!

Well I hope someone has soms suggestions for my problemen. I'm struggeling with it for several weeks now, and tried every solution i could think of.

Persisting object with collections is not a problem, but when i try to update a collection, hibernate seems to ignore de updated data. I know you have explicitly tell hibernate to also update collection, but still than it doesn't seem to work. Here my entity classes:

entity Form:
Code:
[...]

   @ManyToMany(cascade = CascadeType.MERGE, fetch = FetchType.EAGER)
   @JoinTable(name = "form_theme", catalog = "webloket_dji", joinColumns = { @JoinColumn(name = "forms_ID", nullable = false, updatable = true) }, inverseJoinColumns = { @JoinColumn(name = "themeList_ID", nullable = false, updatable = true) })
   private Set<Theme> themeList;
[...]

[...]
entity Theme:
Code:
    @ManyToMany(mappedBy="themeList", cascade=CascadeType.MERGE,    fetch=FetchType.EAGER)
    @Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE)
   private Set<Form> forms;
[...]


how i call the merge method:
Code:
   @Transactional
   public Form update(Form form) {
      logger.debug("Updating form with id: "       + form.getId());
      logger.debug("Number of Themes in form: "    + form.getThemeList().size());
      logger.debug("Number of Chars in form: "    + form.getSearchChars().size());
      
      return getJpaTemplate().merge(form);
   }


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 19, 2008 8:26 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
please use the standard question template, especially the version number is missing in your post.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 20, 2008 3:41 am 
Newbie

Joined: Tue Feb 19, 2008 8:51 am
Posts: 2
emmanuel wrote:
please use the standard question template, especially the version number is missing in your post.


Hi Emmanuel,

Thnx for you reaction, but could you give me some more information. How do I use the standard template en what do you mean by the version number?

Kind regards

Jan-Martijn


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 20, 2008 1:19 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
The template was inserted when you created the post.

Quote:
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html



the hibernate version numbers are displayed in the logs at INFO level when the SessionFActory starts up[/code]

_________________
Emmanuel


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.