[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2780) named parameter types

jose (JIRA) noreply at atlassian.com
Tue Aug 14 05:09:13 EDT 2007


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.5, 3.2.4.sp1
            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