Re: [Hibernate-devel] Re: Select queries, queries by criteria, query by example

2002-07-31 Thread Christian Meunier
> I *do* think "query by example" is pretty cool - but could you tell me
> how they distinguish a null value from an unset property ... or a zero
> primitive value from an unset property? I never figured that out...
>
> thoughts?

I am pretty sure they assume that any Null value / zero primitive is an
unset one.
We could check how Cocobase is dealing with this since it supports QBE.

Chris




---
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
___
Hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel



[Hibernate-devel] Re: Select queries, queries by criteria, query by example

2002-07-31 Thread Gavin_King/Cirrus%CIRRUS

>Query By Criteria and Query By Example
>(Query By example could use Query by criteria internally)
>
>Here's an example for queryByCriteria
>Query query = new Query();
>Query.addBetweenCriteria("age", new Integer(10), new Integer(20));
>Query.addOrderByCriteria("name");
>
>QueryByExample:
>Customer cust = new Customer();
>cust.setStatus(5);
>Collection customers = Session.queryByExample(cust);
>(returns all customers with status == 5)
>
>Do you think this makes sense and is worth implementing?

Query by criteria is a standard kind of approach and is the approach
used in SmallTalky kinds of solutions that I loosely based Hibernate
upon.

I'm personally *not* keen on it, it sacrifices much brevity +
expressiveness for the sake of looking superficially more
object oriented (and a little more compile-time checking).

If you think about some of the things you can express in the latest
version of Hibernate's query language (subqueries, aggregate functions,
some, exists, all, etc) they are quite difficult to express by
composing objects.

I am particularly suspicious of the API explosion entailed by
something like this. You would need more interfaces for this than
Hibernate's whole current API.

Query by example: this is really cool and if you want to think about
how we could implement it, go ahead


sorry ... more later ... taxi is here



---
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
___
Hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel