Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.0.5
Mapping documents:
<class>
...
<set
name="optionalFields"
lazy="true"
inverse="true"
cascade="all"
sort="unsorted"
>
<key>
<column name="ID_LAUNCH_WAIT" />
</key>
<one-to-many
class="myPackage.LaunchWaitOptionalField"
/>
<filter name="fdOptionalField" condition=":fpOptionalField = ID_OPTIONAL_FIELDS"/>
</set>
</class>
<filter-def name="fdOptionalField">
<filter-param name="fpOptionalField" type="long"/>
</filter-def>
Code between sessionFactory.openSession() and session.close():
// -- begin : Hibernate filter
if(filter.getHibernateFilter() != null){
log.info("hibernateFilter=" + filter.getHibernateFilter() +" for " + clazz.getName());
getSession().enableFilter("fdOptionalField").setParameter("fpOptionalField ", filter.getHibernateFilter());
}
// -- end : Hibernate filter
Full stack trace of any exception that occurs:
java.lang.IllegalArgumentException: Invalid filter-parameter name format
at org.hibernate.impl.SessionImpl.parseFilterParameterName(SessionImpl.java:803)
at org.hibernate.impl.SessionImpl.getFilterParameterValue(SessionImpl.java:767)
at org.hibernate.engine.QueryParameters.processFilters(QueryParameters.java:342)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1131)
at org.hibernate.loader.Loader.doQuery(Loader.java:390)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
at org.hibernate.loader.Loader.doList(Loader.java:1593)
at org.hibernate.loader.Loader.list(Loader.java:1577)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:111)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1322)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:300)
Name and version of the database you are using:[ /b]
[b]The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
I try to use filter in hibernate 3.0.5 and i get this error "Invalid filter-parameter name format" . Someone has an idea ?
Other clue : after decompilated hibernate peace of code where exception is thrown :
private String[] parseFilterParameterName(String filterParameterName)
{
int dot = filterParameterName.indexOf('.');
if(dot <= 0)
{
throw new IllegalArgumentException("Invalid filter-parameter name format");
} else
{
String filterName = filterParameterName.substring(0, dot);
String parameterName = filterParameterName.substring(dot + 1);
return (new String[] {
filterName, parameterName
});
}
}