You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Michael Gentry <mg...@masslight.net> on 2010/08/06 14:35:06 UTC

Re: Strange insertion of UPPER when Ordering by TIMESTAMP in SQL Server

Just curious, did you use SortOrder.DESCENDING_INSENSITIVE?

mrg


On Fri, Aug 6, 2010 at 12:10 AM, Gary Jarrel <ga...@gmail.com> wrote:
> Hi All
>
> Using SQL Server I have a table with a DATETIME column. When I run a
> Cayenne Query with an Oder By clause in Descending Mode, the resulting
> SQL looks something like:
>
> SELECT UPPER(t0.date_created)
> FROM product t0
> ORDER BY UPPER(t0.date_created) DESC
>
> In the Modeler these columns show up as TIMESTAMP
>
> Is there a reason a UPPER is being used, it seems like it's trying to
> do a case insensitive ordering on a non character based column.
>
> Thank you
>
> Gary
>

Re: Strange insertion of UPPER when Ordering by TIMESTAMP in SQL Server

Posted by Andrus Adamchik <an...@objectstyle.org>.
I am afraid in this case it is a responsibility of the user to specify  
case sensitivity. Cayenne doesn't try to second guess here.

Andrus

On Aug 11, 2010, at 3:10 AM, Gary Jarrel wrote:

>> Just curious, did you use SortOrder.DESCENDING_INSENSITIVE?
>>
>> mrg
>>
>>
>
> Yes that is the case, I've just had a look through my code and it is
> being set. The reason though is that we have a small generic DAO
> package which has methods such as
>
> findObjectsByParameters(Class<T> objectEntity, Map<?, ?> params,
> OrderedMap<String, Boolean> ordering);
>
> It then build the query and executes it, however by default when
> adding Ordering it uses SortOrder.ASCENDING_INSENSITIVE and
> SortOrder.ASCENDING_INSENSITIVE,
>
> I would have thought that the the case insensitivity would be applied
> only to String based fields and ignored for Date fields?
>
> Thank you
>
> Gary
>


Re: Strange insertion of UPPER when Ordering by TIMESTAMP in SQL Server

Posted by Gary Jarrel <ga...@gmail.com>.
> Just curious, did you use SortOrder.DESCENDING_INSENSITIVE?
>
> mrg
>
>

Yes that is the case, I've just had a look through my code and it is
being set. The reason though is that we have a small generic DAO
package which has methods such as

findObjectsByParameters(Class<T> objectEntity, Map<?, ?> params,
OrderedMap<String, Boolean> ordering);

It then build the query and executes it, however by default when
adding Ordering it uses SortOrder.ASCENDING_INSENSITIVE and
SortOrder.ASCENDING_INSENSITIVE,

I would have thought that the the case insensitivity would be applied
only to String based fields and ignored for Date fields?

Thank you

Gary

Re: Web site link to example and a proposal for a new example link

Posted by Andrus Adamchik <an...@objectstyle.org>.
Hi Martin,

I see. I guess the concept of a "framework as an example" wasn't  
immediately clear to me. Now I added a link to Yafra to the examples  
page. Thanks a lot for your work!

Andrus


On Aug 8, 2010, at 11:16 PM, Martin Weber wrote:
> Hi Andrus,
>
> agree with your point, wrong location and it is easy to find it in  
> google. I still think it would be worth adding a link to http://yafra.sourceforge.net/ 
>  with a short description like "Using Cayenne within different java  
> technologies - a jump start".
>
> The whole framework is based on Apache Cayenne. My driving point was  
> building different applications with a database as central back end.  
> Apache Cayenne was the ORM of choice. Instead of building a concrete  
> application to share with others, the idea came up to share all the  
> findings and the chosen approaches as a sort of a framework. The  
> framework shows how I embedded Apache Cayenne into Apache Wicket or  
> in simple console/batch programs or with a fat client written in  
> Eclipse RCP using EJB's (not using JPA) to access the Cayenne layer.
>
> I will put some more effort into the trac sourceforge.net page to  
> give a better understanding how yafra shall be used.
>
> Hope it helps,
> Cheers,
> Martin
>
>
> On 08.08.2010 20:59, Andrus Adamchik wrote:
>> Hi Martin,
>>
>>> May I suggest to add the Apache Cayenne examples below the success
>>> stories on the main page or within the success stories. The examples
>>> are quite hard to find (it's referenced on the cwiki index page)  
>>> and I
>>> could find it only through google for apache cayenne examples.
>>
>> I don't think examples belong on success stories page, as the  
>> purpose of
>> the later is quite different - to highlight the use of Cayenne on  
>> some
>> real-life projects. But answering your general point... The problem  
>> with
>> the examples on cwiki, namely this link -
>> https://cwiki.apache.org/CAY/cayenne-examples.html , is that all of
>> those are old, unmaintained (as a matter of fact I just removed/ 
>> changed
>> some links that no longer work), and many are likely obsolete.
>>
>> This is a #1 link shown to me by Google when searching for "cayenne
>> examples", so it is not hard to find per se, but the question is  
>> whether
>> we want to endorse our old set of examples. I'd say them staying a  
>> step
>> away from the main site is actually good in current situation :-)
>>
>>> If possible, somebody could add the link to my project as a further
>>> example of using cayenne within different technology setups. A  
>>> link to
>>> http://yafra.sourceforge.net/ would be excellent. It is yet another
>>> framework, but not in fact to be reused as such, more to get / take
>>> what you need to have a better learning curve.
>>>
>>> I used cayenne with the DTO pattern within EJB3 setup serving an
>>> Eclipse RCP EJB3 fat client (using Apache OpenEJB). As well a small
>>> example using Apache Wicket with Cayenne. Working on a Google Web
>>> Toolkit example and would like to move on to Eclipse Riena using
>>> distributed OSGi (they use Hessian as well, seems to be an  
>>> interesting
>>> example). With the yafra framework I did already a ROP example, but
>>> not yet published. All sources are under SVN as Eclipse projects. I
>>> use Trac to document.
>>
>> Could you provide links to the parts of Yafra that can be used as
>> standalone Cayenne examples (does this request even make sense in the
>> context of Yafra? Not sure how it is organized) Or maybe  
>> alternatively
>> you can provide us with a small writeup, explaining those parts  
>> that we
>> can put on the wiki with links back to the appropriate pieces of  
>> Yafra?
>>
>> Cheers,
>> Andrus
>>
>


Re: Web site link to example and a proposal for a new example link

Posted by Martin Weber <ww...@hispeed.ch>.
Hi Andrus,

agree with your point, wrong location and it is easy to find it in 
google. I still think it would be worth adding a link to 
http://yafra.sourceforge.net/ with a short description like "Using 
Cayenne within different java technologies - a jump start".

The whole framework is based on Apache Cayenne. My driving point was 
building different applications with a database as central back end. 
Apache Cayenne was the ORM of choice. Instead of building a concrete 
application to share with others, the idea came up to share all the 
findings and the chosen approaches as a sort of a framework. The 
framework shows how I embedded Apache Cayenne into Apache Wicket or in 
simple console/batch programs or with a fat client written in Eclipse 
RCP using EJB's (not using JPA) to access the Cayenne layer.

I will put some more effort into the trac sourceforge.net page to give a 
better understanding how yafra shall be used.

Hope it helps,
Cheers,
Martin


On 08.08.2010 20:59, Andrus Adamchik wrote:
> Hi Martin,
>
>> May I suggest to add the Apache Cayenne examples below the success
>> stories on the main page or within the success stories. The examples
>> are quite hard to find (it's referenced on the cwiki index page) and I
>> could find it only through google for apache cayenne examples.
>
> I don't think examples belong on success stories page, as the purpose of
> the later is quite different - to highlight the use of Cayenne on some
> real-life projects. But answering your general point... The problem with
> the examples on cwiki, namely this link -
> https://cwiki.apache.org/CAY/cayenne-examples.html , is that all of
> those are old, unmaintained (as a matter of fact I just removed/changed
> some links that no longer work), and many are likely obsolete.
>
> This is a #1 link shown to me by Google when searching for "cayenne
> examples", so it is not hard to find per se, but the question is whether
> we want to endorse our old set of examples. I'd say them staying a step
> away from the main site is actually good in current situation :-)
>
>> If possible, somebody could add the link to my project as a further
>> example of using cayenne within different technology setups. A link to
>> http://yafra.sourceforge.net/ would be excellent. It is yet another
>> framework, but not in fact to be reused as such, more to get / take
>> what you need to have a better learning curve.
>>
>> I used cayenne with the DTO pattern within EJB3 setup serving an
>> Eclipse RCP EJB3 fat client (using Apache OpenEJB). As well a small
>> example using Apache Wicket with Cayenne. Working on a Google Web
>> Toolkit example and would like to move on to Eclipse Riena using
>> distributed OSGi (they use Hessian as well, seems to be an interesting
>> example). With the yafra framework I did already a ROP example, but
>> not yet published. All sources are under SVN as Eclipse projects. I
>> use Trac to document.
>
> Could you provide links to the parts of Yafra that can be used as
> standalone Cayenne examples (does this request even make sense in the
> context of Yafra? Not sure how it is organized) Or maybe alternatively
> you can provide us with a small writeup, explaining those parts that we
> can put on the wiki with links back to the appropriate pieces of Yafra?
>
> Cheers,
> Andrus
>

Re: Web site link to example and a proposal for a new example link

Posted by Andrus Adamchik <an...@objectstyle.org>.
Hi Martin,

> May I suggest to add the Apache Cayenne examples below the success  
> stories on the main page or within the success stories. The examples  
> are quite hard to find (it's referenced on the cwiki index page) and  
> I could find it only through google for apache cayenne examples.

I don't think examples belong on success stories page, as the purpose  
of the later is quite different - to highlight the use of Cayenne on  
some real-life projects. But answering your general point... The  
problem with the examples on cwiki, namely this link - https://cwiki.apache.org/CAY/cayenne-examples.html 
  , is that all of those are old, unmaintained (as a matter of fact I  
just removed/changed some links that no longer work), and many are  
likely obsolete.

This is a #1 link shown to me by Google when searching for "cayenne  
examples", so it is not hard to find per se, but the question is  
whether we want to endorse our old set of examples. I'd say them  
staying a step away from the main site is actually good in current  
situation :-)

> If possible, somebody could add the link to my project as a further  
> example of using cayenne within different technology setups. A link  
> to http://yafra.sourceforge.net/ would be excellent. It is yet  
> another framework, but not in fact to be reused as such, more to  
> get / take what you need to have a better learning curve.
>
> I used cayenne with the DTO pattern within EJB3 setup serving an  
> Eclipse RCP EJB3 fat client (using Apache OpenEJB). As well a small  
> example using Apache Wicket with Cayenne. Working on a Google Web  
> Toolkit example and would like to move on to Eclipse Riena using  
> distributed OSGi (they use Hessian as well, seems to be an  
> interesting example). With the yafra framework I did already a ROP  
> example, but not yet published. All sources are under SVN as Eclipse  
> projects. I use Trac to document.

Could you provide links to the parts of Yafra that can be used as  
standalone Cayenne examples (does this request even make sense in the  
context of Yafra? Not sure how it is organized) Or maybe alternatively  
you can provide us with a small writeup, explaining those parts that  
we can put on the wiki with links back to the appropriate pieces of  
Yafra?

Cheers,
Andrus

Web site link to example and a proposal for a new example link

Posted by Martin Weber <ww...@hispeed.ch>.
Hi,

May I suggest to add the Apache Cayenne examples below the success 
stories on the main page or within the success stories. The examples are 
quite hard to find (it's referenced on the cwiki index page) and I could 
find it only through google for apache cayenne examples.

If possible, somebody could add the link to my project as a further 
example of using cayenne within different technology setups. A link to 
http://yafra.sourceforge.net/ would be excellent. It is yet another 
framework, but not in fact to be reused as such, more to get / take what 
you need to have a better learning curve.

I used cayenne with the DTO pattern within EJB3 setup serving an Eclipse 
RCP EJB3 fat client (using Apache OpenEJB). As well a small example 
using Apache Wicket with Cayenne. Working on a Google Web Toolkit 
example and would like to move on to Eclipse Riena using distributed 
OSGi (they use Hessian as well, seems to be an interesting example). 
With the yafra framework I did already a ROP example, but not yet 
published. All sources are under SVN as Eclipse projects. I use Trac to 
document.

You can follow twitter yafraorg or contact yafraorg@gmail.com.

Cheers,
Martin