You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by Craig L Russell <Cr...@Sun.COM> on 2005/12/19 20:25:14 UTC

Issue 149: Restrictions on Ordering expression used with Grouping

Javadogs,

See JIRA issue JDO-243 http://issues.apache.org/jira/browse/JDO-243? 
page=all
Ordering should have the same restrictions as for the Select clause.  
That is, if grouping is used, only expressions in the Grouping clause  
and aggregate expressions can be in the Ordering clause.
The JDO implementation is not permitted to modify the Select clause,  
the Grouping clause, or the Ordering clause. These are user-visible  
and should not be changed by the implementation.
However, the JDO implementation is required to construct valid SQL if  
the query is being used with a relational datastore. This means that  
the SQL SELECT might need to have expressions added to the user's  
Select clause to include expressions in the Grouping and Ordering  
clauses.
Today in the specification there are restrictions on the expressions  
that can be used in the Select clause if there is a Grouping clause:
<spec 14.6.10>
Only expressions in the Grouping clause and aggregate expressions can  
be in the Select clause.
</spec 14.6.10>
A similar restriction is needed for the Ordering clause.
<proposed>
Only expressions in the Grouping clause and aggregate expressions can  
be in the Ordering clause.
</proposed>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Re: InstanceLifecycleListener on detached instances

Posted by Craig L Russell <Cr...@Sun.COM>.
Hi Erik,

Ah. I missed the context earlier. I don't see any technical issues.

My biggest concern is that it's getting late in the cycle to add new  
features.

What do other experts think? Is it worthwhile to open the spec for this?

Craig

On Dec 28, 2005, at 2:58 AM, erik@jpox.org wrote:

> Craig,
>
> A callback called when a detached instance is changed. (gets dirty)
>
> Regards,
>
> Quoting Craig L Russell <Cr...@Sun.COM>:
>
>> Hi Erik,
>>
>> JDO 2 did not define any additional instance lifecycle callbacks, so
>> there are none for JDO 2 features.
>>
>> The dirty callback is executed during a lifecycle change from clean
>> to dirty, so it's not really suitable.
>>
>> What problem are you trying to solve?
>>
>> Craig
>>
>> On Dec 22, 2005, at 11:36 AM, erik@jpox.org wrote:
>>
>>> Hi,
>>>
>>> Instance lifecycle listeners are only invoked if a PM is involved,
>>> but for
>>> detached instances none are called. The dirty listener is one that
>>> IMO could be
>>> called for detached instances. It means during detachment, a Dirty
>>> listener is
>>> assigned from the attached to the detached instance.
>>>
>>> Any thoughts?
>>
>> Craig Russell
>> Architect, Sun Java Enterprise System http://java.sun.com/products/ 
>> jdo
>> 408 276-5638 mailto:Craig.Russell@sun.com
>> P.S. A good JDO? O, Gasp!
>>
>>
>
>
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Re: InstanceLifecycleListener on detached instances

Posted by er...@jpox.org.
Craig,

A callback called when a detached instance is changed. (gets dirty)

Regards,

Quoting Craig L Russell <Cr...@Sun.COM>:

> Hi Erik,
>
> JDO 2 did not define any additional instance lifecycle callbacks, so
> there are none for JDO 2 features.
>
> The dirty callback is executed during a lifecycle change from clean
> to dirty, so it's not really suitable.
>
> What problem are you trying to solve?
>
> Craig
>
> On Dec 22, 2005, at 11:36 AM, erik@jpox.org wrote:
>
> > Hi,
> >
> > Instance lifecycle listeners are only invoked if a PM is involved,
> > but for
> > detached instances none are called. The dirty listener is one that
> > IMO could be
> > called for detached instances. It means during detachment, a Dirty
> > listener is
> > assigned from the attached to the detached instance.
> >
> > Any thoughts?
>
> Craig Russell
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
>
>




Re: InstanceLifecycleListener on detached instances

Posted by Craig L Russell <Cr...@Sun.COM>.
Hi Erik,

JDO 2 did not define any additional instance lifecycle callbacks, so  
there are none for JDO 2 features.

The dirty callback is executed during a lifecycle change from clean  
to dirty, so it's not really suitable.

What problem are you trying to solve?

Craig

On Dec 22, 2005, at 11:36 AM, erik@jpox.org wrote:

> Hi,
>
> Instance lifecycle listeners are only invoked if a PM is involved,  
> but for
> detached instances none are called. The dirty listener is one that  
> IMO could be
> called for detached instances. It means during detachment, a Dirty  
> listener is
> assigned from the attached to the detached instance.
>
> Any thoughts?

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


InstanceLifecycleListener on detached instances

Posted by er...@jpox.org.
Hi,

Instance lifecycle listeners are only invoked if a PM is involved, but for
detached instances none are called. The dirty listener is one that IMO could be
called for detached instances. It means during detachment, a Dirty listener is
assigned from the attached to the detached instance.

Any thoughts?

RE: Negative [VOTE] Issue 149: Restrictions on Ordering expression used with Grouping

Posted by er...@jpox.org.
Thanks for the clarification
 
Erik Bengtson
-----Original Message-----
From: Craig.Russell@Sun.COM [mailto:Craig.Russell@Sun.COM] 
Sent: Saturday, December 24, 2005 4:26 AM
To: Apache JDO project; JDO Expert Group
Subject: Re: Negative [VOTE] Issue 149: Restrictions on Ordering
expression used with Grouping
 
Hi Erik,
 
I think we actually agree, and the wording of my proposal was poor.
 
On Dec 22, 2005, at 5:48 AM, erik@jpox.org wrote:



-1.
 
In order, I prefer adding columns in SQL (SELECT) as appropriate, but
only
returning to the user the columns/fields listed in setResult.
 
I agree. Exactly what I meant to say. This:
 
However, the JDO implementation is required to construct valid SQL
if the query is being used with a relational datastore. This means
that the SQL SELECT might need to have expressions added to the
user's Select clause to include expressions in the Grouping and
Ordering clauses.
 
should have said this:
 
However, the JDO implementation is required to construct valid SQL
if the query is being used with a relational datastore. This means
that the SQL SELECT might need to have expressions that are not in the
user's Select clause to include expressions in the Grouping and
Ordering clauses. These expressions are not returned to the user.
 
Ok?
 
Craig


 
For grouping, I'm ok with raising an exception when expressions are not
declared
by user
 
Regards,
 
Quoting Craig L Russell <Cr...@Sun.COM>:
 
Javadogs,
 
Please reply if you do not agree.
 
Craig
 
On Dec 19, 2005, at 11:25 AM, Craig L Russell wrote:
 
Javadogs,
 
See JIRA issue JDO-243 http://issues.apache.org/jira/browse/JDO-243?
page=all
Ordering should have the same restrictions as for the Select
clause. That is, if grouping is used, only expressions in the
Grouping clause and aggregate expressions can be in the Ordering
clause.
The JDO implementation is not permitted to modify the Select
clause, the Grouping clause, or the Ordering clause. These are user-
visible and should not be changed by the implementation.
However, the JDO implementation is required to construct valid SQL
if the query is being used with a relational datastore. This means
that the SQL SELECT might need to have expressions added to the
user's Select clause to include expressions in the Grouping and
Ordering clauses.
Today in the specification there are restrictions on the
expressions that can be used in the Select clause if there is a
Grouping clause:
<spec 14.6.10>
Only expressions in the Grouping clause and aggregate expressions
can be in the Select clause.
</spec 14.6.10>
A similar restriction is needed for the Ordering clause.
<proposed>
Only expressions in the Grouping clause and aggregate expressions
can be in the Ordering clause.
</proposed>
 
Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!
 
 
Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!
 
 
 
 
 
 
Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!
 

Re: Negative [VOTE] Issue 149: Restrictions on Ordering expression used with Grouping

Posted by Craig L Russell <Cr...@Sun.COM>.
Hi Erik,

I think we actually agree, and the wording of my proposal was poor.

On Dec 22, 2005, at 5:48 AM, erik@jpox.org wrote:

> -1.
>
> In order, I prefer adding columns in SQL (SELECT) as appropriate,  
> but only
> returning to the user the columns/fields listed in setResult.

I agree. Exactly what I meant to say. This:

>>> However, the JDO implementation is required to construct valid SQL
>>> if the query is being used with a relational datastore. This means
>>> that the SQL SELECT might need to have expressions added to the
>>> user's Select clause to include expressions in the Grouping and
>>> Ordering clauses.

should have said this:

>>> However, the JDO implementation is required to construct valid SQL
>>> if the query is being used with a relational datastore. This means
>>> that the SQL SELECT might need to have expressions that are not  
>>> in the
>>> user's Select clause to include expressions in the Grouping and
>>> Ordering clauses. These expressions are not returned to the user.

Ok?

Craig
>
> For grouping, I'm ok with raising an exception when expressions are  
> not declared
> by user
>
> Regards,
>
> Quoting Craig L Russell <Cr...@Sun.COM>:
>
>> Javadogs,
>>
>> Please reply if you do not agree.
>>
>> Craig
>>
>> On Dec 19, 2005, at 11:25 AM, Craig L Russell wrote:
>>
>>> Javadogs,
>>>
>>> See JIRA issue JDO-243 http://issues.apache.org/jira/browse/JDO-243?
>>> page=all
>>> Ordering should have the same restrictions as for the Select
>>> clause. That is, if grouping is used, only expressions in the
>>> Grouping clause and aggregate expressions can be in the Ordering
>>> clause.
>>> The JDO implementation is not permitted to modify the Select
>>> clause, the Grouping clause, or the Ordering clause. These are user-
>>> visible and should not be changed by the implementation.
>>> However, the JDO implementation is required to construct valid SQL
>>> if the query is being used with a relational datastore. This means
>>> that the SQL SELECT might need to have expressions added to the
>>> user's Select clause to include expressions in the Grouping and
>>> Ordering clauses.
>>> Today in the specification there are restrictions on the
>>> expressions that can be used in the Select clause if there is a
>>> Grouping clause:
>>> <spec 14.6.10>
>>> Only expressions in the Grouping clause and aggregate expressions
>>> can be in the Select clause.
>>> </spec 14.6.10>
>>> A similar restriction is needed for the Ordering clause.
>>> <proposed>
>>> Only expressions in the Grouping clause and aggregate expressions
>>> can be in the Ordering clause.
>>> </proposed>
>>>
>>> Craig Russell
>>> Architect, Sun Java Enterprise System http://java.sun.com/ 
>>> products/jdo
>>> 408 276-5638 mailto:Craig.Russell@sun.com
>>> P.S. A good JDO? O, Gasp!
>>>
>>
>> Craig Russell
>> Architect, Sun Java Enterprise System http://java.sun.com/products/ 
>> jdo
>> 408 276-5638 mailto:Craig.Russell@sun.com
>> P.S. A good JDO? O, Gasp!
>>
>>
>
>
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Re: Negative [VOTE] Issue 149: Restrictions on Ordering expression used with Grouping

Posted by er...@jpox.org.
-1.

In order, I prefer adding columns in SQL (SELECT) as appropriate, but only
returning to the user the columns/fields listed in setResult.

For grouping, I'm ok with raising an exception when expressions are not declared
by user

Regards,

Quoting Craig L Russell <Cr...@Sun.COM>:

> Javadogs,
>
> Please reply if you do not agree.
>
> Craig
>
> On Dec 19, 2005, at 11:25 AM, Craig L Russell wrote:
>
> > Javadogs,
> >
> > See JIRA issue JDO-243 http://issues.apache.org/jira/browse/JDO-243?
> > page=all
> > Ordering should have the same restrictions as for the Select
> > clause. That is, if grouping is used, only expressions in the
> > Grouping clause and aggregate expressions can be in the Ordering
> > clause.
> > The JDO implementation is not permitted to modify the Select
> > clause, the Grouping clause, or the Ordering clause. These are user-
> > visible and should not be changed by the implementation.
> > However, the JDO implementation is required to construct valid SQL
> > if the query is being used with a relational datastore. This means
> > that the SQL SELECT might need to have expressions added to the
> > user's Select clause to include expressions in the Grouping and
> > Ordering clauses.
> > Today in the specification there are restrictions on the
> > expressions that can be used in the Select clause if there is a
> > Grouping clause:
> > <spec 14.6.10>
> > Only expressions in the Grouping clause and aggregate expressions
> > can be in the Select clause.
> > </spec 14.6.10>
> > A similar restriction is needed for the Ordering clause.
> > <proposed>
> > Only expressions in the Grouping clause and aggregate expressions
> > can be in the Ordering clause.
> > </proposed>
> >
> > Craig Russell
> > Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> > 408 276-5638 mailto:Craig.Russell@sun.com
> > P.S. A good JDO? O, Gasp!
> >
>
> Craig Russell
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
>
>




Negative [VOTE] Issue 149: Restrictions on Ordering expression used with Grouping

Posted by Craig L Russell <Cr...@Sun.COM>.
Javadogs,

Please reply if you do not agree.

Craig

On Dec 19, 2005, at 11:25 AM, Craig L Russell wrote:

> Javadogs,
>
> See JIRA issue JDO-243 http://issues.apache.org/jira/browse/JDO-243? 
> page=all
> Ordering should have the same restrictions as for the Select  
> clause. That is, if grouping is used, only expressions in the  
> Grouping clause and aggregate expressions can be in the Ordering  
> clause.
> The JDO implementation is not permitted to modify the Select  
> clause, the Grouping clause, or the Ordering clause. These are user- 
> visible and should not be changed by the implementation.
> However, the JDO implementation is required to construct valid SQL  
> if the query is being used with a relational datastore. This means  
> that the SQL SELECT might need to have expressions added to the  
> user's Select clause to include expressions in the Grouping and  
> Ordering clauses.
> Today in the specification there are restrictions on the  
> expressions that can be used in the Select clause if there is a  
> Grouping clause:
> <spec 14.6.10>
> Only expressions in the Grouping clause and aggregate expressions  
> can be in the Select clause.
> </spec 14.6.10>
> A similar restriction is needed for the Ordering clause.
> <proposed>
> Only expressions in the Grouping clause and aggregate expressions  
> can be in the Ordering clause.
> </proposed>
>
> Craig Russell
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!