You can get all EXCEPT fields in an HQL query.
Sort of:
session.get(entityClass, id).withoutThisField(fieldNotDesired)
Example : I have a class Picture(int id, String name , byte[] file) .
I want to get all the snapshots except the field file.
I know that I can do this if I clarify the required fields, but I do not want to update my query every time a new field is added.
I know if the field is a blob, it will be retrieved only if necessary. This is none of my business.
And the bytecode tool for the exact field lazy=true does not work, I have strange exceptions.
Thanks in advance.
source share