-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Query By Example documentation?
PostPosted: Wed Dec 31, 2003 2:14 pm 
Beginner
Beginner

Joined: Wed Dec 31, 2003 1:40 pm
Posts: 25
Hi, with great interest I read that Hibernate now has an approach for QBE. That is wonderful. However I could not find it mentioned while searching the documentation or the Hibernate site (apart from the announcement in the news-section.) I only found a short example in the API doc for the Example class but that still leaves some questions open.

Particularly I wonder how relationships are handled in the QBE case. Also, how can user-defined types be used for subsumption style mapping? I don't expect all of this to exist, but would appreciate some explanation to the approach and the roadmap.

Thanks,
-Gunther


Top
 Profile  
 
 Post subject: Re: Query By Example documentation?
PostPosted: Thu Jan 01, 2004 12:14 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
gschadow wrote:
Particularly I wonder how relationships are handled in the QBE case. Also, how can user-defined types be used for subsumption style mapping? I don't expect all of this to exist, but would appreciate some explanation to the approach and the roadmap.

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.

What do you men by "subsumption style mapping?"


Top
 Profile  
 
 Post subject: Re: Query By Example documentation?
PostPosted: Thu Jan 01, 2004 10:52 pm 
Beginner
Beginner

Joined: Wed Dec 31, 2003 1:40 pm
Posts: 25
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


Top
 Profile  
 
 Post subject: Re: Query By Example documentation?
PostPosted: Mon Jan 24, 2005 1:23 pm 
Newbie

Joined: Mon Jan 24, 2005 1:17 pm
Posts: 1
Location: Dallas, TX
Has any consideration been giving for adding the ability for QBE to include associations? If not, can someone share their code that walks the associations and includes them in the generated SQL?

Thanks,
James


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 24, 2005 3:54 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
hibernate in action

you have details for managing association via criteria
mix criteria.createCriteria + QBE

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.