Sleep mode and prepared expression

As far as I can find on google, hibernate uses PreparedStatement for its queries.

I need to execute a request consisting of two parts, the first part of which can be written in sleeping criteria, and the second - dblink, so sleep mode cannot be used.

So, I would like to extract the PreparedStatement object from the Criteria object.

Criteria criteria = getSession().createCriteria(Entity.class);
//adding restrictions
PreparedStatement stmt;
//initializing stmt with criteria PreparedStatement

How can i do this? Is it possible?

+4
source share
2 answers

Hibernate API. . , getSession().createCriteria(Entity.class) - , Hibernate PreparedStatement ( Entity Entity).

, , - . , , "" . (, , ..). Hibernate , .

, , , , , , , Hibernate - API, SQL.

+3

, dblink , .

, .

DetachedCriteria .

+3

Source: https://habr.com/ru/post/1589416/


All Articles