I've got SharedObject that gets inherited by client and server-end code as ClientObject, ServerObject. ServerObject is meant to be used with EJB3 while ClientObject knows nothing about it.
SharedObject define variable that need to get persisted. I tried defining them as @ManyToOne but I have no idea what to put for targetEntity because at the level of SharedObject, it knows nothing about the implementation it will eventually get mapped to (the implementation does not even exist within the same JAR file or classpath so it can't see it even if it wanted to). As far as I know, I can't use @ManyToOne against interfaces, nor can I define @ManyToOne inside ServerObject for a variable which was declared by a superclass.
Any ideas on how to solve this problem?