How you fix the following Hibernate error:
What does \"Use of the same entity name twice\".
This exception occures when you have more then one @Entity with the same class's name or explicit name. To fix the issue you have to set different explicit names for each entity.
Example of error case:
package A;
@Entity
class Cell{
...
}
package B;
@Entity
class Cell{
...
}
Solution example: package A;
@Entity(name="a.Cell")
class Cell{
...
}
package B;
@Entity(name="b.Cell")
class Cell{
...
}
So, to use them in HQL you have to write
...createQuery("from a.Cell")...