[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-2168) SQLQuery - use rowIndex for scalar queries

Max Rydahl Andersen (JIRA) noreply at atlassian.com
Sat Oct 21 09:57:04 EDT 2006


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2168?page=all ]
     
Max Rydahl Andersen closed HHH-2168:
------------------------------------

    Resolution: Rejected

either you want autodiscovery of names or you won't want it.

use .addScalar(name) to have the default typing work for the name.

> SQLQuery - use rowIndex for scalar queries
> ------------------------------------------
>
>          Key: HHH-2168
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2168
>      Project: Hibernate3
>         Type: Improvement

>   Components: query-sql
>     Versions: 3.2.0.ga
>  Environment: Hibernate 3.2.0.ga
> Oracle 10g Database
>     Reporter: Luiz dos Santos Faias Junior
>     Priority: Minor

>
>
> When org.hibernate.SQLQuery is used the default column types are java.sql.Date and java.math.BigDecimal.
> If I need to specify the types I use addScalar for all columns, but if I'm making a report probably there will be a few columns I want the default type.
> So my suggestion is to create a method :
> addScalar(java.lang.String columnAlias, org.hibernate.type.Type type, int columnIndex);
> or
> addScalar(int columnIndex, org.hibernate.type.Type type);
> Example :
> SQLQuery query = session.createSQLQuery( " select user_id, user_name, last_login from users " );
> where last_login should be a java.sql.Timestamp.
> I want the first and second columns to use the default type ( int and String ), and the third column I want to specify Timestamp instead of java.sql.Date
> So I could only write : query.addScalar("last_login", Hibernate,.TIMESTAMP, 2);
> or addScalar(2, Hibernate.TIMESTAMP);     (using the columnIndex).
> thanks,
> Luiz Faias
> São Paulo - Brasil

-- 
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