7 messages in org.xwiki.devsRe: [xwiki-devs] [Proposal] QueryMana...
FromSent OnAttachments
Artem MelentyevMay 25, 2008 8:08 am 
Vincent MassolMay 25, 2008 9:03 am 
Artem MelentyevMay 25, 2008 11:18 am 
Vincent MassolMay 25, 2008 12:11 pm 
Vincent MassolMay 26, 2008 2:35 am 
Artem MelentyevMay 28, 2008 5:31 am 
Vincent MassolMay 28, 2008 5:47 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [xwiki-devs] [Proposal] QueryManager in storeActions...
From:Artem Melentyev (amel@gmail.com)
Date:May 25, 2008 11:18:36 am
List:org.xwiki.devs

Hi, Vincent.

Vincent Massol wrote:

2) Only use the methods that you need now and add methods as they are needed in the future. For ex if there's no need right now for named queries we should probably not use it (Of course we should think about all use cases so that we have a solution should they arise).

Ok

3) Why do we still need a QueryPlugin? I don't think it's needed anymore with the QueryManager. For me the Query Plugin should be modified to be one of the Query implementation (HQL, XPath - this one -, JCRSQL, etc).

We need also some secure query (ex: QueryPlugin's xpath for Hibernate is secure, so it checks "query" right if query contains some non public fields), but yes, it can be some language in QueryManager.

4) I'd really like that we try to remove any velocity-specific API so that we have only 1 Java API for all. Maybe we can introduce some velocity tools to handle the cases where you think it is required. What would be those cases?

Main issue are check rights for returned documents and shorter API (ex: QueryManager#xpath(""), Query#setParams(List)).

We can expose QueryManager as the QueryPlugin (ex: xwiki.getQuery() returns QueryManager, without plugin api), add some shorter methods and protect #createQuery by our @Programming annotation. WDYT?

5) Why do we need to write Language.HQL.name() and not Language.HQL?

Because "Language" is Java5 enum, but QueryManager#createQuery require String (for adding new Languages without modify the Language enum). Ok. This is not good, so I propose to:

public interface Query { static final String HQL = "hql"; static final String XPATH = "xpath"; ... } And use qm.createQuery("...", Query.HQL); As well as in the JCR. (JCR don't use enums because targets at Java1.4)