Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Same Entity in different packages.  RSS feed

 
ambar patil
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can, and the way to do that is to include the package name in the @Entity name.

Mark
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!