You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by Andrus Adamchik <an...@objectstyle.org> on 2010/01/21 21:54:30 UTC

Re: svn commit: r901627 - in /cayenne/main/trunk: docs/doc/src/main/resources/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ framework/cayenne-jdk1.5-unpublished/src/main/jjtree/org/apache/cayenne/ejbql/ framework/

On Jan 21, 2010, at 10:38 PM, Andrey Razumovsky wrote:

> So, following specification, this cannot be performed anyhow?

No. But the idea I guess is that pattern is not another column value.  
It is always a literal.

>
> I agree subselects in LIKE is not good, then maybe let's change that  
> to
> input_parameter() | string_literal() | functions_returning_strings() ?
> Specification does not say what to do if right part is not input  
> parameter
> or string literal. So is it really bad if we do more than  
> specification
> says?

I think it doesn't buy us much. LIKE is a rather special case IMO, and  
this is reflected in the spec.

> Another weird thing is that pattern_value() unlike other expressions  
> is not
> described in BNF on pages 109-112..

True. It is described in the text only. The EJBQL BNF is rather  
sketchy in some parts.

Andrus


Re: svn commit: r901627 - in /cayenne/main/trunk: docs/doc/src/main/resources/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ framework/cayenne-jdk1.5-unpublished/src/main/jjtree/org/apache/cayenne/ejbql/ framework/

Posted by Andreas Hartmann <an...@apache.org>.
Am 21.01.10 21:54, schrieb Andrus Adamchik:

[…]

>> Another weird thing is that pattern_value() unlike other expressions
>> is not
>> described in BNF on pages 109-112..
>
> True. It is described in the text only. The EJBQL BNF is rather sketchy
> in some parts.

They are refering to the SQL spec for a thorough definition of 
pattern_value in the footnote 27 on page 93. It really is only a string 
literal with a special syntax.

-- Andreas



-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


Re: svn commit: r901627 - in /cayenne/main/trunk: docs/doc/src/main/resources/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ framework/cayenne-jdk1.5-unpublished/src/main/jjtree/org/apache/cayenne/ejbql/ framework/

Posted by Andreas Hartmann <an...@apache.org>.
Am 21.01.10 21:54, schrieb Andrus Adamchik:
>
> On Jan 21, 2010, at 10:38 PM, Andrey Razumovsky wrote:
>
>> So, following specification, this cannot be performed anyhow?
>
> No. But the idea I guess is that pattern is not another column value. It
> is always a literal.

Yes, the tutorial emphasizes this: "The pattern value is a string 
literal that may contain wildcard characters."

http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/EJBQL5.html

I find this restriction rather strange, but maybe the authors couldn't 
think of a reasonable real-world scenario which requires a dynamically 
generated pattern.

-- Andreas


>
>>
>> I agree subselects in LIKE is not good, then maybe let's change that to
>> input_parameter() | string_literal() | functions_returning_strings() ?
>> Specification does not say what to do if right part is not input
>> parameter
>> or string literal. So is it really bad if we do more than specification
>> says?
>
> I think it doesn't buy us much. LIKE is a rather special case IMO, and
> this is reflected in the spec.
>
>> Another weird thing is that pattern_value() unlike other expressions
>> is not
>> described in BNF on pages 109-112..
>
> True. It is described in the text only. The EJBQL BNF is rather sketchy
> in some parts.
>
> Andrus
>
>


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


Re: svn commit: r901627 - in /cayenne/main/trunk: docs/doc/src/main/resources/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ framework/cayenne-jdk1.5-unpublished/src/main/jjtree/org/apache/cayenne/ejbql/ framework/

Posted by Andrus Adamchik <an...@objectstyle.org>.
On Jan 21, 2010, at 11:19 PM, Andrey Razumovsky wrote:

> I've always thought of EJBQL as of sort of OOP-analogue of SQL. So  
> while
> those thinks look logical and work in SQL, why shouldn't they in  
> EJBQL..
> So I'm not fully convinced, but if you wish (?), I'll revert that  
> change

Thanks for doing that. The way I see the EJBQL evolution in Cayenne is  
that in 3.0 it is String-only, JPA-compatible. In 3.1+ it becomes an  
API or String-based (CQL extends EJBQL), JPA compatible, but with  
Cayenne extensions.

Andrus


Re: svn commit: r901627 - in /cayenne/main/trunk: docs/doc/src/main/resources/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/exp/parser/ framework/cayenne-jdk1.5-unpublished/src/main/jjtree/org/apache/cayenne/ejbql/ framework/

Posted by Andrey Razumovsky <ra...@gmail.com>.
I've always thought of EJBQL as of sort of OOP-analogue of SQL. So while
those thinks look logical and work in SQL, why shouldn't they in EJBQL..
So I'm not fully convinced, but if you wish (?), I'll revert that change

2010/1/21 Andrus Adamchik <an...@objectstyle.org>

>
> On Jan 21, 2010, at 10:38 PM, Andrey Razumovsky wrote:
>
>  So, following specification, this cannot be performed anyhow?
>>
>
> No. But the idea I guess is that pattern is not another column value. It is
> always a literal.
>
>
>
>> I agree subselects in LIKE is not good, then maybe let's change that to
>> input_parameter() | string_literal() | functions_returning_strings() ?
>> Specification does not say what to do if right part is not input parameter
>> or string literal. So is it really bad if we do more than specification
>> says?
>>
>
> I think it doesn't buy us much. LIKE is a rather special case IMO, and this
> is reflected in the spec.
>
>
>  Another weird thing is that pattern_value() unlike other expressions is
>> not
>> described in BNF on pages 109-112..
>>
>
> True. It is described in the text only. The EJBQL BNF is rather sketchy in
> some parts.
>
> Andrus
>
>


-- 
Andrey