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:Vincent Massol (vinc@massol.net)
Date:May 26, 2008 2:35:56 am
List:org.xwiki.devs

On May 25, 2008, at 9:12 PM, Vincent Massol wrote:

[snip]

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"; ... }

btw you don't need static final in an interface ;)

Actually I wouldn't do it like this. Since we're now using components I would create a Query interface and create each implementation as a component. That component will be registered with a <role-hint> of "hql", "xpath", etc.

Actually this is orthogonal. For the component lookup we simply need a string which can come from an enum or from a static final String. I'm fine with the String.

Still we should implement the Queries as components.

Thanks -Vincent