I have the following defined Entity Model:
public class Type {
    private String description;
    private String value;
 
    public Type() {
        super();
    }
 
    ....
}
 
... and the following Entity OData definition:
<EntityType Name="Type">
        <Key>
                <PropertyRef Name="Value"/>
                <PropertyRef Name="Description"/>
        </Key>
        <Property Name="Value" Type="Edm.String" Nullable="false" 
MaxLength="100" Unicode="false" FixedLength="false"/>
        <Property Name="Description" Type="Edm.String" Nullable="false" 
MaxLength="100" Unicode="false" FixedLength="false"/>
</EntityType>
 
It works OK, but yesterday the OData Entity was changed to:
<EntityType Name="Type">
        <Key>
                <PropertyRef Name="Value"/>
                <PropertyRef Name="Description"/>
        </Key>
        <Property Name="Value" Type="Edm.String" Nullable="false" 
MaxLength="100" Unicode="false" FixedLength="false"/>
        <Property Name="Description" Type="Edm.String" Nullable="false" 
MaxLength="100" Unicode="false" FixedLength="false"/>
        <NavigationProperty Name="Cars" 
Relationship="CarsODataModel.CarTypeCar" FromRole="Type" ToRole="Car"/>
</EntityType>
 
... and now it fails with the following exception because I have not defined 
the property "Cars":
java.lang.NoSuchFieldException: assetInProcesses
        at java.lang.Class.getDeclaredField(Class.java:1882)
        at 
org.restlet.ext.odata.internal.reflect.ReflectUtils.getSimpleClass(ReflectUtils.java:117)
        at 
org.restlet.ext.odata.internal.EntryContentHandler.startLink(EntryContentHandler.java:685)
 
and then:
java.lang.NullPointerException
        at 
org.restlet.ext.odata.internal.edm.Metadata.getEntityType(Metadata.java:152)
        at 
org.restlet.ext.odata.internal.EntryContentHandler.<init>(EntryContentHandler.java:162)
 
 
How can I define my Entity Model (java) in the way to not require to add new 
properties ("Cars" in this case) if the service change?
Thanks

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2944234

Reply via email to