[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2780) named parameter types
Gail Badner (JIRA)
noreply at atlassian.com
Wed Aug 15 14:05:13 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2780?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_27848 ]
Gail Badner commented on HHH-2780:
----------------------------------
Please attach a runnable test case (java and mapping).
> named parameter types
> ---------------------
>
> Key: HHH-2780
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2780
> Project: Hibernate3
> Issue Type: Patch
> Components: query-hql
> Affects Versions: 3.2.4.sp1, 3.2.5
> Reporter: jose
>
> This query FAILS______________________
> from Entity e
> where ((:status is null) or (e.status = :status))
> This query WORK______________________
> from Entity e
> where ((e.status = :status)) or (:status is null))
> Fixed with_________________________________
> Constructor of org.hibernate.hql.ast.ParameterTranslationsImpl
> ...
> else if ( NamedParameterSpecification.class.isAssignableFrom( spec.getClass() ) ) {
> NamedParameterSpecification namedSpec = ( NamedParameterSpecification ) spec;
> NamedParamTempHolder paramHolder = ( NamedParamTempHolder ) namedParameterMap.get( namedSpec.getName() );
> if ( paramHolder == null ) {
> paramHolder = new NamedParamTempHolder();
> paramHolder.name = namedSpec.getName();
> paramHolder.type = namedSpec.getExpectedType();
> namedParameterMap.put( namedSpec.getName(), paramHolder );
> *** }else{
> *** if (paramHolder.type == null){
> *** paramHolder.type = namedSpec.getExpectedType();
> *** }
> *** }
> paramHolder.positions.add( new Integer( i ) );
> }
> else {
> // don't care about other param types here, just those explicitly user-defined...
> }
--
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