Sometimes, when getting an object from database by primary key, I’d like to use session.get(xxx.class, xxxPk) which is really simple and convience. However, this always triggers a query which retrieved all fields and cause unnecessary network overhead, especially when some unneeded fields is huge. I know I can use criteria query to solve this problem, but I still hope to avoid more code compared with session.get().
The only way to avoid querying all columns is to write the query yourself.