Sleep mode, aliases

I noticed that hibernate generates different aliases for the same columns every time I try to access the same table:

Hibernate: select person0_.id as id0_0_, person0_.nam as nam0_0_, person0_.fam as fam0_0_, person0_.otc as otc0_0_ from web_db.Person person0_ where person0_.id=? Hibernate: select person0_.id as id4_0_, person0_.nam as nam4_0_, person0_.fam as fam4_0_, person0_.otc as otc4_0_ from web_db.Person person0_ where person0_.id=? 

Is there a way to go to sleep to create identical aliases for identical requests? For example:

 Hibernate: select person0_.id as id0_0_, person0_.nam as nam0_0_, person0_.fam as fam0_0_, person0_.otc as otc0_0_ from web_db.Person person0_ where person0_.id=? Hibernate: select person0_.id as id0_0_, person0_.nam as nam0_0_, person0_.fam as fam0_0_, person0_.otc as otc0_0_ from web_db.Person person0_ where person0_.id=? 
+6
java alias orm hibernate
source share
4 answers

Have a look at HHH-2448 , which covers this section and has a patch for generating a deterministic alias.

+4
source share

Firstly, I am using Oracle 9i.

Various requests force the server to perform hard parsing. If there are many such requests, the responsibility of the database server falls. We must use bind variables to avoid this problem.

+2
source share

In any case, my solution is named queries, where I will indicate how to explicitly select data ...

+2
source share

Short answer: nope

Why?
What is not the point? You are abstracted from the actual request requests.

-one
source share

All Articles