Open GoogleCodeExporter opened 8 years ago
[deleted comment]
Wrong file attached. Here is the correct file.
Original comment by gcandroi...@gmail.com
on 16 Aug 2013 at 8:44
Attachments:
The culprit is in EdmDataServices.getEdmEntitySet( EdmEntityType type ).
This function searches the entity set collection looking for a source for the
type specified in the parameter. The type provided by the framework is, in this
case, a subclass of FeedItem called Narrative. The function, however, does not
travel up the inheritance chain of the supplied type to determine whether the
entity set's type is a superclass.
After putting in a search it seems to work.
The new function looks like this:
public EdmEntitySet getEdmEntitySet(final EdmEntityType type) {
if (type == null)
throw new IllegalArgumentException("type cannot be null");
EdmEntitySet ees = Enumerable.create(getEntitySets())
.firstOrNull(new Predicate1<EdmEntitySet>() {
@Override
public boolean apply(EdmEntitySet input) {
boolean rv = false;
// travel up the inheritance chain to validate.
// if type is a an instance or subclass of the input, return true.
EdmEntityType subclass = type;
while( !rv && null != subclass ) {
rv = subclass.equals( input.getType() );
subclass = subclass.getBaseType();
}
return rv;
}
});
if (ees != null) {
return ees;
}
throw new NotFoundException("EdmEntitySet " + type.getName() + " is not found");
}
I don't know what side effects this change might have, but this caused the
error to go away.
Original comment by gcandroi...@gmail.com
on 20 Aug 2013 at 8:57
Original issue reported on code.google.com by
gcandroi...@gmail.com
on 16 Aug 2013 at 8:42