|
Consider the below SQL generate by Hibernate for reading an object by primary key.
select person0_.ID as ID1_0_0_, person0_.firstName as firstNam3_0_0_, person0_.lastName as lastName4_0_0_, person0_.salary as salary5_0_0_, from Person person0_ where person0_.ID=?
I do not understand the reason for naming person0_ with a zero and an underscore. This naming strategy makes the query unreadable and probably un-cacheable by the database such that the DB has to generate a new plan every time for this query (Not too sure about this one though, but answers on StackOverflow seem to indicate this).
I looked at http://docs.jboss.org/hibernate/orm/4.2/devguide/en-US/html/ but could not find any good reason for this naming strategy. Please note this in documentation if this is a feature, else it should be removed.
|