Re: one-to-many persistence, ConstraintViolationException

2010-06-22 Thread Ken
Thank you for sharing, Here is something you might find useful: I don't know if you know about MySQL workbench? It will help you define your database schema. It gives a nice graphical layout, it's free... I'm using Ubuntu linux 10.04 and there was some issue, with it where I needed to download

Re: one-to-many persistence, ConstraintViolationException

2010-06-22 Thread Jake Vang
ken, thanks for responding. i got things to work, but i haven't figured out really why it's working (on a conceptual, philosophical level). here's what i did to the code above. 1. for the Company class, i removed the @ForeignKey annotation 2. for the Employee class, i removed the companyId field.

Re: one-to-many persistence, ConstraintViolationException

2010-06-22 Thread Ken
I'm sorry I quickly scanned this and didn't read it in full... Here is my 2 cents. "InnoDB rejects any INSERT or UPDATE operation that attempts to create a foreign key value in a child table if there is no a matching candidate key value in the parent table." So the parent has a valid entry befor

one-to-many persistence, ConstraintViolationException

2010-06-21 Thread Jake Vang
i am following the example at http://struts.apache.org/2.1.8.1/docs/struts-2-spring-2-jpa-ajax.html. in this example, a very simple persistence is given (of which i am thankful). but, what i am trying to do is slightly more complicated with persistence. i need to persist a one-to-many relationship.