You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Shankara (JIRA)" <ji...@apache.org> on 2017/05/04 03:57:04 UTC

[jira] [Created] (OLINGO-1118) Filter on Enum field doesn't work

Shankara created OLINGO-1118:
--------------------------------

             Summary: Filter on Enum field doesn't work
                 Key: OLINGO-1118
                 URL: https://issues.apache.org/jira/browse/OLINGO-1118
             Project: Olingo
          Issue Type: Bug
          Components: odata2-jpa
    Affects Versions: V2 2.0.7
            Reporter: Shankara


Hi,
We've an Enum field for an entity which is shown as Edm.String in metadata.
When we do a filter on a a field which has Enum as field type it throws an error saying cannot cast String to Enum.

Medata:
<EntityType Name="ExtendedActivation">
<Key>
<PropertyRef Name="ConfigurationType"/>
<PropertyRef Name="Id"/>
</Key>
<Property Name="ConfigurationType" Type="Edm.String" Nullable="false" MaxLength="255"/>
<Property Name="ConfigurationXml" Type="Edm.String" Nullable="false" MaxLength="2147483647"/>
<Property Name="Id" Type="Edm.String" Nullable="false" MaxLength="45"/>
</EntityType>

OData Filter Call: <Odata serivce base url>//ExtendedActivations?$filter=ConfigurationType eq 'GENERIC_TYPE'

Exception:

Internal Exception: java.lang.ClassCastException: Cannot cast class java.lang.String to class java.lang.Enum
Query: ReadAllQuery(referenceClass=ExtendedActivation jpql="SELECT E1 FROM ExtendedActivation E1 WHERE (E1.configurationType = 'GENERIC_TYPE')")

Thanks & Regards
Shankara G



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)