[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2780?page=c...
]
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira