-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Filter issue on hibernate 3.0.5 : Invalid filter-parameter n
PostPosted: Thu Jun 14, 2007 12:54 pm 
Newbie

Joined: Thu Jun 14, 2007 12:41 pm
Posts: 1
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
});
}
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.