gloeglm wrote:
See
http://www.hibernate.org/hib_docs/reference/html/query-criteria.html#query-criteria-s6 - Version properties, identifiers and associations are ignored. You can however place criterias upoon associated objects using the Example API, see the URL.
O.K. thanks. Well, it seems as if it ought to be relatively easy to extend
the Example criteria by automatically walking and including associated
objects. That's wonderful.
gloeglm wrote:
What do you mean by "subsumption style mapping?"
Did I say "mapping", oops. I meant subsumption style querying. By that I mean that a QBE approach is most powerful if you interpret the supplied values as value classes and your query is trying to find anything subsumed by those value classes. That's what you intuitively do with the "case-insensitive" and "like" comparison on string fields. For numeric fields you really want to have something like that too. E.g., you want to put "<5" in a field to match all values less than 5.
The most systematic way of doing this that I know of is to consider all numeric values as intervals. Then you can just supply an interval in the QBE Example field and that matches all subsets. To do this, I need to use a user-extension data type, interval. This needs to be supported on the SQL side as well. When I looked at user-type support in hibernate a year ago or so ago, there were some difficulties with mapping operations such as "subset-of" in SQL... but I can't remember the specifics now.
You also have subsumption semantics for queries on nominal-coded fields, particularly if you have a code system with specializations.
It's great that hibernate is on the right track with the QBE, it can probably become extremely powerful.
regards,
-Gunther