Closed BlueCatSpy closed 11 months ago
Hello, In my opinion the behavior of order by is the correct one and what you describe for filter is wrong. Let me explain why:
I assume that your jpa entity look like follows:
@Entity
public class Bar {
@EmbeddedId
private BarPK id;
...
}
@Embeddable
public class BarPK
@Column(name = "\"...\"", length = ...)
private String foo;
...
}
For my understanding the OData specification does not allow a complex type. E.g. Part 3, 8.2 Element edm:Key states:
The properties that compose the key MUST be non-nullable and typed with an enumeration type, one of the following primitive types, or a type definition based on one of these primitive types: ...
That's why IntermediateEntityType.getKey()
"flats" embedded ids and the metadata document should look like:
<EntityType Name="Bar">
<Key>
<PropertyRef Name="Foo"/>
...
</Key>
...
</EntityType>
I tried to reproduce the behavior you describe, but I was not able to. Please give my more details, so I can find out whats going wrong.
Due to clean-up action. All issues created before 2022 get closed.
While it is possible to filter on a field that is part of a composite key, trying to order by it will raise an exception with a message that looks like the following: Property for 'foo' not found at 'bar'.
A filter expression would filter correctly the foo field to 'bar.id.foo' while the order by is looking for 'bar.foo' which doesn't exist.