By looking at the spring source, I was able to do it now. Case closed.
public User getUser(final String username) throws DataAccessException {
HibernateTemplate template = new...
Type: Posts; User: phoenix; Keyword(s):
By looking at the spring source, I was able to do it now. Case closed.
public User getUser(final String username) throws DataAccessException {
HibernateTemplate template = new...
it sent out SQL to database each time this dao method is called (thus not using seond level cache).
I was using second level cache of hibernate, and the following code, the content in my dao method, works. By that I mean if i repeatly run this dao method, only the first SQL was sent to the DB.
...
It would be nice if hibernate template can support retrieving a single persisted object instead of a list. Also, enabling query cache by the template directly (not through its created Query object )...