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 2009/11/02 08:55:00 UTC

Re: [jira] Commented: (CAY-1300) Format queries in QueryLogger

Agreed - a good idea. This is one of those cases were I feel like we  
need some minimal IoC to be able to manage Cayenne extensions. Until  
we have it, -Dcayenne.query.formatting is the way to go.

Andrus

On Nov 2, 2009, at 5:36 AM, Andrey Razumovsky (JIRA) wrote:

>
>    [ https://issues.apache.org/jira/browse/CAY-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772412 
> #action_12772412 ]
>
> Andrey Razumovsky commented on CAY-1300:
> ----------------------------------------
>
> The idea is excellent. May I suggest that all JOINs are also  
> formatted to be placed on new line? Some sort of QueryFormatter will  
> also be fine.  Also using ThreadLocal for setting "isFormatting"  
> property forces to make this call at any request to format queries.  
> So I think it'll be a good idea to have some static default value  
> for "isFormatting", set by a static call or by adding something like  
> "-Dcayenne.query.formatting=true" to command line
>
>> Format queries in QueryLogger
>> -----------------------------
>>
>>                Key: CAY-1300
>>                URL: https://issues.apache.org/jira/browse/CAY-1300
>>            Project: Cayenne
>>         Issue Type: New Feature
>>         Components: Cayenne Core Library
>>           Reporter: Evgeny Ryabitskiy
>>            Fix For: 3.0
>>
>>        Attachments: CAY-1300.patch
>>
>>
>> Sometimes it's hard to read queries from Logs when queries are huge.
>> It will be nice if user can enable nice query formatting for debug  
>> purposes.
>
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>


Re: [jira] Commented: (CAY-1300) Format queries in QueryLogger

Posted by Evgeny Ryabitskiy <ev...@gmail.com>.
Yes, I can add joins and some other keywords. Also I can make keywords
to upper case and some more tunning.
I am wondering if there is some SQL format standard like Sun
conventions for Java?
It will be nice if you point someone to me...

Evgeny.

2009/11/2 Andrus Adamchik <an...@objectstyle.org>:
> Agreed - a good idea. This is one of those cases were I feel like we need
> some minimal IoC to be able to manage Cayenne extensions. Until we have it,
> -Dcayenne.query.formatting is the way to go.
>
> Andrus
>
> On Nov 2, 2009, at 5:36 AM, Andrey Razumovsky (JIRA) wrote:
>
>>
>>   [
>> https://issues.apache.org/jira/browse/CAY-1300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772412#action_12772412
>> ]
>>
>> Andrey Razumovsky commented on CAY-1300:
>> ----------------------------------------
>>
>> The idea is excellent. May I suggest that all JOINs are also formatted to
>> be placed on new line? Some sort of QueryFormatter will also be fine.  Also
>> using ThreadLocal for setting "isFormatting" property forces to make this
>> call at any request to format queries. So I think it'll be a good idea to
>> have some static default value for "isFormatting", set by a static call or
>> by adding something like "-Dcayenne.query.formatting=true" to command line
>>
>>> Format queries in QueryLogger
>>> -----------------------------
>>>
>>>               Key: CAY-1300
>>>               URL: https://issues.apache.org/jira/browse/CAY-1300
>>>           Project: Cayenne
>>>        Issue Type: New Feature
>>>        Components: Cayenne Core Library
>>>          Reporter: Evgeny Ryabitskiy
>>>           Fix For: 3.0
>>>
>>>       Attachments: CAY-1300.patch
>>>
>>>
>>> Sometimes it's hard to read queries from Logs when queries are huge.
>>> It will be nice if user can enable nice query formatting for debug
>>> purposes.
>>
>> --
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>>
>>
>
>