You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Kiril Gavrailov <kg...@gmail.com> on 2013/03/15 12:59:36 UTC

FIQL search into parent paramterized class

Hey Guys,
I have the following setup:

class A<T> {
private T state;
// getters and setters for state are here.
}

class B extends class A <State1Enum> {
}

class C extends class A <State2Enum> {
}

So when I try to filter with FIQL in class C or class B with filter
state=="SomeValue" the search condition is being returned null since the
enum is not being recognized as itself but as an Object since the getters
and setters are in the parent class and are parametrized and the value of
the filter cannot be parsed properly by the SearchConditionParser parse
method.
I tried to implement an interface that both enums implement and
paratmetrize the class with <T extends BaseInterface>, but then I hit other
problems with my project.

So can you advice me what should I do in order the fiql query by state to
work?

Big thanks in advance.

Regards,
Kiril

Re: FIQL search into parent paramterized class

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 15/03/13 11:59, Kiril Gavrailov wrote:
> Hey Guys,
> I have the following setup:
>
> class A<T>  {
> private T state;
> // getters and setters for state are here.
> }
>
> class B extends class A<State1Enum>  {
> }
>
> class C extends class A<State2Enum>  {
> }
>
> So when I try to filter with FIQL in class C or class B with filter
> state=="SomeValue" the search condition is being returned null since the
> enum is not being recognized as itself but as an Object since the getters
> and setters are in the parent class and are parametrized and the value of
> the filter cannot be parsed properly by the SearchConditionParser parse
> method.
> I tried to implement an interface that both enums implement and
> paratmetrize the class with<T extends BaseInterface>, but then I hit other
> problems with my project.
>
> So can you advice me what should I do in order the fiql query by state to
> work?
>
Thanks for reporting the issue.

I think the FIQL bean-inspector needs to be enhanced a bit to be able to 
introspect the type variables better - I'll check a bit later on - if 
you can spot where the enhancement needs to be done in meantime then it 
would be good. The actual conversion to Enum, once it is known it is 
Enum,  should work, I think we have a test for that.

I guess the workaround is to use String setters.

Thanks, Sergey
> Big thanks in advance.
>
> Regards,
> Kiril
>