Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

EJB3 Entities - Join on Entities in different jar files

 
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?
 
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.
 
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic