hibernate query language or using criteria?
问题 Any one who tell me the query using criteria/hql/sql. Requirement is that user enter email or username the query return the password of the user from table user. 回答1: If all you're doing is fetching one field, you probably just want to go hql (or possibly sql). If you do criteria, I believe you're pulling back the entire object, just to eventually use one field. Edit: That's a really broad question. Here is a tutorial 回答2: The Criteria API is very appropriate for dynamic query generation and