Two entities with the same name in differents packages<>
This question already has an answer here:
Am sure you are not getting a compile time error, its deployment error that you must be encountering. the problem is when you package then into an ear/war before deploying, both the class come to the server. Whilst any JPA application the container does not know which class to invoke, thus it throws an exception
Is it not possible for you to extend one class and carry your operations or you can create an instance of one class in another and add a one-to-one mapping between them.
This implies you have two tables with the same name in your database, which is highly unlikely.
You'll need to use the Entity.name value, or if you're using JPA you can also use the javax.persistence.Table annotation.