Referring to identifier property by R4R Team

There are two ways to refer to an entity's identifier property:


1. The special property (lowercase) id may be used to reference the identifier property of an entity provided that the entity does not define a non-identifier property named id. If the entity defines a named identifier property, you can use that property name.


2. References to composite identifier properties follow the same naming rules. If the entity has a non-identifier property named id, the composite identifier property can only be referenced by its defined named. Otherwise, the special id property can be used to reference the identifier property.


We have to always remember that in the starting version 3.2.2 it has changed significantly. So in the previous version, id always referred to the identifier property regardless of its actual name. A ramification of that decision was that non-identifier properties names id could never be referenced in Hibernate queries.

Leave a Comment:
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!