What is column mapping kind in JPA (Hibernate implementation) entity and what are the differences between these three options available:
- basic
- id
- version
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.
@Basicis used to map a field to a column.@Idis used to tell Hibernate that the field is (or is a part of) the identifier of the entity (i.e. the primary key)@Versionis used to tell Hibernate that the annotated field constitutes the field to use as the version for optimistic locking. This field will be checked before every update, and incremented at each update. It’s described in the documentation under the optimistic locking section.All these annotations are also well described in their javadoc.