I would like to use JPA entity classes as simple POJOs /data holder objects to be passed to other layers/clients of enterprise application.
Can this be done without the other layers/clients having JPA API jar on classpath - (just having jar containing entity classes)? Or do they need this to resolve things like:
@OneToMany(mappedBy="owner",fetch=FetchType.EAGER
) in Entity source code?
If JPA API is needed in the client/presentation layer which is just intended to work with the entity as POJO, what is the best solution/alternative to avoid this necessity of having JPA API depedency?
EDIT: Just to make it more clear. I am asking about possible solutions outside java ee enviroment where JPA API is not at reach. Can I avoid coding DTOs for every Entity class I want to send to standard java client without JPA API?