I think the problem is with your architecture. You have the client interacting directly with the specific persistence implementation, so you introduce dependencies on the persistence layer in the client. If you examine some of the standard design patterns, such as Data Transfer Object (DTO), Data Access Object (DAO), Adapter, etc., you will see that decoupling the two is considered a "best practice". In a J2EE architecture, a client may interact with a Stateless SessionBean, which then delegates to another layer that handles the specifics of the persistence layer. The interface of the SessionBean would be defined in a way that was convenient for the client to use, including returning query results using standard java classes. There would be a translation from the result set returned by the persistence layer, regardless of whether it was a Hibernate result set, or a JDBC results set, an EntityBean, or JDO classes.
Your statement "copying data from the objects into new objects and sending that list but that is EXTREMELY time consuming and is clearly the wrong way to go." is at odds with recommended architectural guideliness for sophisticated J2EE applications. I can't comment on how appropriate it is for your specific application.
When you say "I will have to assume that Hibernate will not work for my case", you should also consider that if the client is tied to JDK 1.1, there are actually very few choices that you will have for your persistence layer if you are making the client directly dependent upon it.
|