Hello all,
i want to exclude only on field from a query, how would i do that?
The problem with this is that sometimes i want the field to be included (if i specify a value for that field) and sometimes i don't want that field to be included (when there is no value specified for that field or it is empty)
The problem is when i use distinct keyword, that one field has to be excluded if it is not set.
I tried annotating the Entity's field with @Transient, which results in the correct behavior, but when i request a query with the transient parameter set the query crashes with:
Quote:
org.hibernate.QueryException: could not resolve property:
Is there a simple/clean solution for this or am i doing s.th. wrong?
If anybody could point me into the correct direction or has at least some keywords for me to search that would be nice ...
Regards,
Jens