openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Curtis (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (OPENJPA-1999) Optional support for non-sequential positional parameters
Date Thu, 26 May 2011 13:45:51 GMT

     [ https://issues.apache.org/jira/browse/OPENJPA-1999?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Rick Curtis updated OPENJPA-1999:
---------------------------------

    Attachment: OPENJPA-1999.patch

@David -

Please give the attached patch a try. I'll note that it's still a little fluid, but I'd like
to get confirmation that it works for you before spending much more time going down this path.

Since this behavior goes against the spec and it worked for one reason or another in a previous
release, I'm not planning on enabling this functionality by default. To enable support for
this feature, you'll have to set a new comparability flag[1].

The gist of this patch is that I mapped all positional parameters to a stringified version
of the param ($1=>:_1). This way the runtime thinks the user has named parameters and the
user thinks they're using positional parameters.

[1]openjpa.Compatibility=ConvertPositionalParametersToNamed=true

> Optional support for non-sequential positional parameters
> ---------------------------------------------------------
>
>                 Key: OPENJPA-1999
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1999
>             Project: OpenJPA
>          Issue Type: Improvement
>          Components: competitive, jpa, query, usability
>            Reporter: David Blevins
>         Attachments: OPENJPA-1999.patch
>
>
> Optional support for less strict following of positional parameters. e.g.
>     Query query = entityManager.createQuery("SELECT m from Movie as m WHERE m.title =
?2 AND m.year = ?4"); 
>     query.setParameter(2, "Foo"); 
>     query.setParameter(4, 2011); 
>     return query.getResultList(); 
> Previous OpenJPA releases support this as do current EclipseLink and Hibernate versions.
 For the migration and upgrade scenarios and the development scenario -- can be a pain to
have to always update positional parameters while tweaking queries -- this could make a compelling
optional feature.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message