-->
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: Naming rules for @Filter and @FilterJoinTable
PostPosted: Thu Oct 18, 2012 11:07 am 
Newbie

Joined: Wed Oct 17, 2012 6:39 am
Posts: 3
Hello!
After resolving my first problem that I posted yesterday I thought of putting some "order" in the filters I have. So I decided to name them with the same logic I have for NamedQueries, hence className.filterName. I ended up having a filter definition as follows:

Code:
@FilterDef(
        name = "className.myLongFilterName", parameters=@ParamDef( name="param", type="type" )
        )

This gives a NullPointerException in line 492 of org.hibernate.engine.spi.QueryParameters.processFilters.

I traced through the source code and noticed that such a filter name gets "split" into two parts on the "." and only the first part is taken as filter name.

So when I assign the parameter, it works properly and I can inspect the filter and see it actually holds the right value for className.myLongFilterName but then processFilters() crashes looking for a filter named just className (which does not exist). To fix it I had to change the filter definition into:

Code:
@FilterDef(
        name = "myLongFilterName", parameters=@ParamDef( name="param", type="type" )
        )

Is this intended behaviour and my fault for missing something from the documentation?

Thanks!

Stefano


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.