-
1. Re: ConstraintViolation & redundant entries
bluetrade Oct 2, 2006 1:48 PM (in response to bluetrade)So I tried the same without the hirarchy by just persisting the same word multiple times (via merge) and that worked. So it's not the PK. So I conclude there is something wrong with the Cascading settings. I use Hibernate Entity Manager 3.2.0CR1 along with Annotations 3.2.0 CR1.
Any clues on this?
THanks,
Joey -
2. Re: ConstraintViolation & redundant entries
bluetrade Oct 2, 2006 1:56 PM (in response to bluetrade)mhm... the EntityManager really seems to propagate the "merge"-operation as a "persist"-operation down...
is this a bug? -
3. Re: ConstraintViolation & redundant entries
bluetrade Oct 2, 2006 2:16 PM (in response to bluetrade)Hi,
so i found the problem but no solution. The problem is that the foreign key of the referenced "Word" is inside the Join-Table marked as unique, which I switched manually to index.
Anyone got any clues on how I can avoid the word_content being unique in the join table? Thanks!!@OneToMany @JoinTable(name="sentence_word", joinColumns={@JoinColumn(name="sentence_id")}, inverseJoinColumns={@JoinColumn(name="word_content",referencedColumnName="content")}) /** * @return the words */ public Collection<Word> getWords() { return words; }
-
4. Re: ConstraintViolation & redundant entries
bluetrade Oct 2, 2006 3:03 PM (in response to bluetrade)After some experimenting I found that I really should have a ManyToMany relationship :)
Thanks anyways...
Joey