-->
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 Parameter Error
PostPosted: Mon Aug 29, 2005 9:55 am 
Newbie

Joined: Tue Aug 23, 2005 11:38 am
Posts: 14
I'm using a filter and parameter on a one to many set (a person can have many cats) and when I go to set the parameter, I get a parameter not found message.

I'm using Hibernate 3.0.5 and here is the code and trace.

MAIN:
Session session = HibernateSessionFactory.currentSession();
Transaction tx = session.beginTransaction();

Person person = (Person) session.createCriteria(Person.class).add(Expression.eq("personId", "4000000789")).uniqueResult();

assertNotNull(person );

session.enableFilter("catsFilter").setParameter("personId", 4000000789);

Set cats = person .getCats();

CLASS:

This is the code in my Person hbm xml.....


<set name="cats" cascade="all" lazy="true">
<key>
<column name="Person_ID" />
</key>
<one-to-many class="Cat" />
<filter name="catsFilter" />
</set>


<filter-def name="catsFilter" condition=":personId = Person_ID" >
<filter-param name="personId" type="java.util.Integer" />
</filter-def>


TRACE:
java.lang.IllegalArgumentException: Undefined filter parameter [personId]at org.hibernate.impl.FilterImpl.setParameter(FilterImpl.java:59)


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.