Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization 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
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

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.
 
BWA HA HA HA HA HA HA! Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!