The moose likes Object Relational Mapping and the fly likes Same Entity in different packages. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "Same Entity in different packages." Watch "Same Entity in different packages." New topic
Author

Same Entity in different packages.

ambar patil
Ranch Hand

Joined: Nov 29, 2005
Posts: 226
Can we use same entity name in different packages.
like :
pkgA.entityA
pkgB.entityA
I am getting error: org.hibernate.AnnotationException: Use of the same entity name twice:
Any workaround ? I dont wann change name..
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16624

Yes you can, and the way to do that is to include the package name in the @Entity name.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
 
subject: Same Entity in different packages.
 
Threads others viewed
Best practice for persistence unit
Reg. Packages
sun.net.www.http.httpclient
How does it affect?
Question about Part 2 assignment.
MyEclipse, The Clear Choice