0

I'm currently PoCing a solution for OData interaction from Java. We have an WCF odata repository available. I began preliminary coding using the restlet API because it has code generation available but since using it I've encountered the situation where a newly created object doesn't have it's ID set upon creation and the addEntity method in the generated service class doesn't appear to return the ID?

Which is a more comprehensive solution, that from Restlet or OData4j?

Thanks, Mark.

Mark Gargan
  • 831
  • 1
  • 9
  • 21

1 Answers1

0

you can manually return the id where you are implementing the producer register method

for example:

producer.register(yourModelClass.class, "yourModelClass", new Func1<Object,Iterable<yourModelClass>>() { 

            public Iterable<yourModelClass> apply(Object queryInfo) {  
                return null;
                }
            }
      }, "yourID");