I want to use existing database. Entity table has a column named code to be used as primary key.
Probably a simple annotation but I am new to Play Framework and JPA.
Thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well actually might not be that straightforward if you are new to play framework.
Play uses the Model class which extends GenericModel which in turn extends JPABase.
The model class enhances the entity with it’s own Id.
So if your entity has it’s own primary key, have it extend GenericModel and define your primary key with @Id: