|Reference entity in other EJB module [message #540654]
||Wed, 16 June 2010 20:52
Registered: June 2010
I have an EAR project that has two EJB modules. Each has it's own persistence unit 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.
Powered by FUDForum
. Page generated in 0.02824 seconds