[hibernate-issues] [Hibernate-JIRA] Commented: (ANN-551) Guaranty the same parameter ordering when overriding SQL across VMs and compilations (Søren Pedersen)

todd orr (JIRA) noreply at atlassian.com
Thu Apr 3 08:50:33 EDT 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29930 ] 

todd orr commented on ANN-551:
------------------------------

Would it be possible to add named parameter support? This would get around this problem in a much more decoupled fashion - no need to determine what order hibernate is trying to insert by beforehand.

> Guaranty the same parameter ordering when overriding SQL across VMs and compilations (Søren Pedersen)
> -----------------------------------------------------------------------------------------------------
>
>                 Key: ANN-551
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-551
>             Project: Hibernate Annotations
>          Issue Type: Bug
>          Components: binder
>    Affects Versions: 3.2.1
>         Environment: Hibernate-core 3.2.2, hibernate-annotations 3.2.1. WebLogic 9.2 and JBoss 4.0.5. Oracle 10.
>            Reporter: Søren Pedersen
>            Assignee: Emmanuel Bernard
>             Fix For: 3.3.0.ga
>
>
> Problem:
> The columns in the sql you specify in SQLInsert annotation has be ordered in the same way hibernate sorts its properties when constructing the insert sql.
> Example:
> When WebLogic 9.2 is used the sql should look like this:
> "insert into acount (name, address, country) values (?,?,?)"
> But when JBoss 4.0.5 is used the sql should look like this:
> "insert into acount (address, country, name) values (?,?,?)"
> The above are only examples.
> Consequence:
> I have to have different SQLInsert's for every JEE apllication server we support, because the properties comes in different order depending on the application server used.
> Suggested solution:
> In the method org.hibernate.cfg.AnnotationBinder.addElementsOfAClass(List<PropertyData> elements, PropertyHolder propertyHolder, boolean isPropertyAnnotated,String propertyAccessor, final XClass annotatedClass, ExtendedMappings mappings)
> This property list shown below should be sorted to make sure that the properties also come in the same order:
> List<XProperty> properties = annotatedClass.getDeclaredProperties( accessType );

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