[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5932?page=c...
]
Tomas Hradec commented on HHH-5932:
-----------------------------------
Hi,I add one test to BasicFilteredBulkManipulationTest in hibernate-testsuite.
{code}
public void testHHH_5932_ExceptionWhenHqlContainsColonAndFilterIsEnabled() {
Session s = openSession();
s.enableFilter("sex").setParameter("sexCode", new
Character('M'));
s.createQuery("select p from Person p where p.name =
':abc'").list();
s.close();
}
{code}
Exception ''Invalid filter-parameter name format" from
LoadQueryInfluencers when hql contains colon and filter is enabled.
--------------------------------------------------------------------------------------------------------------------------
Key: HHH-5932
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5932
Project: Hibernate Core
Issue Type: Bug
Components: query-hql
Affects Versions: 3.6.0
Reporter: Tomas Hradec
Hi,
I am getting exception when executing following code:
{code}
@Entity
@FilterDef(name="personIsActiveFilter", defaultCondition="active =
1")
public class Person {
@Id
Long id;
String name;
boolean active;
}
...
session.enableFilter("personIsActiveFilter");
session.createQuery("from Person p where p.name = ':abc'").list();
{code}
Stack trace is the following:
{code}
java.lang.IllegalArgumentException: Invalid filter-parameter name format
at
org.hibernate.engine.LoadQueryInfluencers.parseFilterParameterName(LoadQueryInfluencers.java:162)
at org.hibernate.engine.QueryParameters.processFilters(QueryParameters.java:485)
at org.hibernate.engine.QueryParameters.processFilters(QueryParameters.java:458)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1669)
at org.hibernate.loader.Loader.doQuery(Loader.java:801)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
at org.hibernate.loader.Loader.doList(Loader.java:2533)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
at org.hibernate.loader.Loader.list(Loader.java:2271)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
{code}
I can´t use named query parameter because whole where clause is built in another part of
application.
--
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