No idea why, but I can suggest why not. Prepared statements are reasonably lightweight and don't take long to construct. Inserts and updates are simple operations, referring to columns in a single table. There isn't much advantage to caching the statements on the java side. And the database caches execution plans on the server side, so you get that performance benefit whether you use an old statement object, or a new one.
Query statements, however, can be very complex, referring to many tables, inclyuding subselects, and thus can involve some overhead at creation time. So hibernate can cache them, to avoid creating them more than once.
_________________ Code tags are your friend. Know them and use them.
|