JDO Query Specification
Date: 2000/07/04
Message-ID: <8jtbto$dcs$13$1_at_news.t-online.com>#1/1
Hi all,
tomorrow, July 5th, is the last day for public review of Sun's Java Data
Object specification.
http://access1.sun.com/jdo/
JDO could be the key concept for the breakthrough of object databases.
If that could be of importance to you, I would be interested to hear your opinion on the following mail I just sent:
> Please have another close look at the query interface.
>
> In my opinion String parameters are not a good choice.
> Disadvantages for application developers:
> - Typechecking will not be available at design time.
> - If existing instances of objects are used to generate query parameters,
an
> extra step to transfer them to Strings will be necessary.
> Disadvantages for JDO vendors:
> - The coding effort to evaluate queries will either include String parsing
> or a creation of Java Classes and compilation during runtime.
>
> I would prefer the simplest possible object-oriented way to express a
query:
>
> 1. Template
> Query criteria are described by template objects.
> Any PersistenceCapable object can be used as a template object.
> All non null fields of a template object are used as query criteria.
> Instantiated fields of the template also describe the depth of the desired
> instantiation for retrieval.
>
> 2. Query
> An unlimited number of template objects can be joined together to make up
a
> Query. This is done by calling
> Query.and(PersistenceCapable templateObject)
> or
> Query.or(PersistenceCapable templateObject)
> The order of adding denotes the order of evaluation.
>
> An optional parameter describes the desired processing info for the newly
> added template.
> "==" is default.
> Options: "!=", ">", "<", ">=", "<=", "orderby", "contains", "group",
"sum",
> average", "maximum", "minimum" ...and more
>
>
> Two queries can be joined by
> Query1.and(Query2)
> or
> Query1.or(Query2)
>
> Query1.subQuery(Query2) makes Query2 a subquery of Query1
>
> 3. Execute
> Collection = PersistenceManager.execute(Query)
> No additional parameters have to be supplied.
>
> Simplicity rules!
>
> I will be happy to supply code examples if I have left any points unclear.
>
> My implementation will support a simple shortcut version of the above:
> Collection = PersistenceManager.get(PersistenceCapable templateObject)
>
> I would be delighted to participate in a further specification of this
> concept.
>
> Please excuse conceptional mistakes, but I had to make the 5th of July
> deadline.
>
> Regards,
> Carl Rosenberger
> db4o - database for objects - http://www.db4o.com
Received on Tue Jul 04 2000 - 00:00:00 CEST