Foreing key using JPA

View: New views
2 Messages — Rating Filter:   Alert me  

Foreing key using JPA

by Mahesh Yamsani :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, I am new to JPA, can any one help me creating a foreign key using JPA Annotation.

I tried with ManytoOneand Join Column , I got an exception during data insertion from my child table, as it is saying like, set constraint was failed.

Re: Foreing key using JPA

by James Sutherland :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

See,
http://en.wikibooks.org/wiki/Java_Persistence/ManyToOne

Otherwise, include some specific information such as the exception and stack, SQL, model, code, etc.