4 Replies Latest reply on Jan 31, 2006 10:32 AM by jason.greene

    EJB3 Entities with CMRs Returned via JAX-RPC

      I've hit a little bit of a roadblock dealing with an EJB3 persistent Entity that is also returned via an operation on one of my JAX-RPC Service endpoints. The problem is this; the class being returned has a CMR to another EJB3 Entity. Let's say the model looks like this:

      Invoice <>---> LineItem (Invoice has a Collection of LineItems)

      In order to set this CMR up, you have to use a java.util.Collection. The problem here is that when I run wscompile, it (wscompile) notices that it needs to return Invoice from one of my Service Endpoints and complains that one of it's (Invoice's) properties is a Collection.

      So, it's looking like I can have only one or the other here. I can either stop using the explicit CMR to or I can stop returning that object via my endpoint. Neither one of those solutions are very palatable. I'm sure that I could just code a JAX-RPC compliant version (DTO like) of Invoice, but that seems a waste. Is there a solution out there to this problem that I'm missing?