• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDO 2.0: JDOQL Article Series - Part 2 Just Released

 
Neelan Choksi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Part 2 of Robin Roos's four-part series on JDOQL has just been released at http://www.theserverside.com/articles/article.tss?l=JDOQueryPart2. The articles in this series illustrate the new capabilities which the forthcoming JDO 2.0 standard is bringing to JDOQL.

Part 1 can be found at http://www.theserverside.com/articles/article.tss?l=JDOQueryPart1.

The spec team has spent a lot of time and effort listening to the community and improving JDOQL. Check it out and judge for yourself.

Neelan
neelan@solarmetric.com
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Neelan I have asked this before, but no comments on this. Is it only me or is it the reality that JDOQL is going on ODMG solution (so looking very alike HQL)?

./pope
 
Robin Roos
author
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ali

I haven't answered directly since I have no experience of ODMG. We added the single-string form of JDOQL to make queries easier to express.

When named queries are declared in metadata they will use the single-string form, instead of an XML structure with individual elements for each JDOQL clause (filter, ordering, imports) as was first envisaged.

However single-string JDOQL is just a new expression of the same language. The capabilities of single-string queries and API-defined queries are no different. We've merely added tokens to demarcate the various clauses.

Cheers, Robin.
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Robin. I have checked the ODMG site and it seems pretty obvious that single-strings queries are coming from here . I guess I was not wrong when I've said it is in the same line as HQL.

./pope
 
Robin Roos
author
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ali

Did you read my query article Part II? What do you think of JDOQL's new power?

Thanks, Robin.
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shamely me :roll: , I haven't till now... but I promise I will and come back to u.

./pope
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read it. Now the impressions :-).
I think that JDOQL has gone a long way ... in the good direction and it shows now a lot of power. I like very much the idea of objectual querying, i.e.:


This is quite impressive and I find it very neat. But in a way reading the articles I had the feeling that the spec stopped in the middle and proposed:

I consider the above unnecessary API. I am not sure (and I mostly believe that currently this is not possible), but I would write the above:

Why I would like this? Because in this way all the querying is objectual and no additional API is involved. Unfortunately the above hides a little problem too: compile time check. If I change the AuctionItem, than I will discover that my query is broken only at runtime (this maybe has already required a redeploy of the app). So I think the best solution would allow you to build the query actively:

(note the missing quotes; but still a problem as I needed an instance of AuctionItem :-( ).
Hoping you got my point, I would like to move forward.
I like that a lot of aggregate function have been taken into account, but again I feel it is a mix: what does it really mean in objectual model count() or distinct? These are rather DB functions and I would like to have it that way: probably by setting on each or maybe better .

And finally - at least for the moment - I would not go for inventing new notations/notions for something already existing: indeed regexp can be seen as a good selection filter but I haven't seen the (?i) till now. Also why bothering to create unbound variables when an implicit variable would solve it? Here I might be wrong as I see some interesting usage in


these are my first thoughts.

./pope

ps: most probably i will post these on my blog too in to detail 'em
[ November 13, 2004: Message edited by: Ali Pope ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic