Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple Record insertion in one-to-many relationship  RSS feed

 
Carlos Conti
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Greenhorns!,

I have a very curious case, where in a one-to-many relationshiop from entity A-to-B, when editing instance A and adding new records of B (all done through a web page, not an automated process), the added records of entity B are duplicated, so everytime I check records of instance B attached to A,they appear replicated two more times than expected in the database.

In my application there are many cases where I need to implement this kind of relationship, but this issue is arising in this very particular one. Moreover the process is done in a very similar manner in all cases (one page with an input control section, and another section containing a table where the registered records are displayed.

The only difference I can think of (which I realized while posting this topic), is that in this particular case, there is one field which is inputted through an <ice:inputRichtext/>, whereas in the other cases, none input control of this kind is used. Can that be the reason? I can doublecheck that. However I need this input control to be a richText control.

Can anybody give me any insight on what can this be due to?

Best regards and thanks in advance,
Carlos.
 
Shannon McGee
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have cascading set up? If you are inserting them yourself, you only need to do one or the other.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!