I'm having a problem with using Eclipse and referring to
entities between two different EJB modules. I posted the message below
in the Web Tools Project forum under Eclipse thinking that the issue
comes from how I have things set up in Eclipse, but haven't gotten a
response back. I know this isn't really an EclipseLink issue, but
thought someone here might still be able to give me some pointers.
I've read everything I can think of and can't figure out what I'm
doing wrong.
Renee
------------------------------------------
I have an EAR project that has two EJB
modules. Each has it's own persistence.xml file which references a
separate
database. One database contains the content entities I'm using and the
other contains information about the users who will be accessing that
content. I can access each database/EJB module individually without any
problems.
I now need to create a new configuration entity in the user database
that is owned by a user, but references some of the content entities
from the other EJB module.
In the properties for the user EJB module, I set the dependency on the
content EJB module and also have the project reference set and so I
thought that would allow me to access the content entities. However,
when I try, I get an error on the @ManyToOne mapping saying that the
"Target entity is not an Entity." It is specifically listed in the
persistence.xml file, though, and is definitely an entity in the other
module.
@ManyToOne(targetEntity = com.test.configuration.CommonConfig.class)
private CommonConfig mainConfig;
I'm still fairly new to understanding how all of this works and I'm
hoping that there's just something basic that I'm not doing correctly.
>From everything I've read, I should be able to package entities in two
different modules and reference them with no problems, so any help in
figuring out what I'm doing wrong would be much appreciated!
Also, if there's a better place to post this question, please let me
know.
Thanks!
Renee