• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB3 Entities - Join on Entities in different jar files  RSS feed

 
Anurag Bhatia
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to do a join on 2 entities AttrEntity and DescEntity. The problem is that the AttrEntity and DescEntity are in different jar files so when I execute the query I get an exception saying that the entity DescEntity was not found. Is there anyway I can execute this query while not modifying my jar files?
 
Vineet Mangal
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create an EAR and add both the jars in that.
 
Anurag Bhatia
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is the way it is already setup.
 
Christian Gossart
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are both of your entities participating in the same persistence unit?
If this persistence unit is defined in one jar, did you import the other with a <jar-file> element in the persistence.xml ?
If you activate logging during the persistence unit creation, do you see the two entities in the list of mapped classes? (I know EclipseLink and Hibernate log this kind of information)
If you define your query as a named query with @NamedQuery, is it accepted by the persistence provider?
 
Anurag Bhatia
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used the <jar-file> tag in the second jar file. That made it work.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!