[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-906) Support better readable results when toString isn't implemented for "select new SomeObject(p1, p2, p3)" statements

Max Rydahl Andersen (JIRA) noreply at atlassian.com
Tue Feb 27 03:04:32 EST 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-906?page=comments#action_26323 ] 

Max Rydahl Andersen commented on HBX-906:
-----------------------------------------

>You *can't know* or you currently don't have >the information at your fingertips? 

the hql parser does this transformation internally and I don't have access to the resulting resulttransformer - and even if I had it can't tell me what the return type is.

One thing I could probably do/detect is that there is only one object available in the actual row and just not put values into those remaing rows.

>One way of doing might be to transform >"select new Obj(p1, p2, p3) from..." under the >covers into "select p1, p2, p3 from..." This >way, the results come back in a nice, orderly, >decomposed fashion every time - and you still >have the semantic equivalent to what the user >actually typed.

But then you can't test if the query you want to execute actually can be executed...;)

> Support better readable results when toString isn't implemented for "select new SomeObject(p1, p2, p3)" statements
> ------------------------------------------------------------------------------------------------------------------
>
>          Key: HBX-906
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-906
>      Project: Hibernate Tools
>         Type: New Feature

>     Versions: 3.2beta8
>     Reporter: Joseph Marques

>
>
> If I have some class called SomeObject WITHOUT a toString method, and I have some statement like "select new SomeObject(p1, p2, p3)", the results look like
> 0
> SomeObject at 19cd8ea
> SomeObject at 65168f
> SomeObject at ac1d0e
> SomeObject at 1a79e4
> SomeObject at 9cd89b
> SomeObject at 11c00d8
> ...
> Instead, why not attempt to show the results as:
>   0                              1                              2
> <p1.toString()>     <p2.toString()>     <p3.toString()>
> <p1.toString()>     <p2.toString()>     <p3.toString()>
> <p1.toString()>     <p2.toString()>     <p3.toString()>
> In other words, statements like "select new SomeObject(p1, p2, p3) ..." should default to the same results that "select p1, p2, p3 ..." would.
> Thoughts?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list