tpalfalvi wrote:
You should decide if you want to annotate the getters or the fields themselves, and then stick to that decision. Don't annotate both, it will probably confuse Hibernate. Try removing one of the @Id annotations and see if you still get an error.
I tried it with the following:
Code:
@Entity
public class A implements IA {
private int id;
@Id
public final int getId() {
return id;
}
public B getB() {
return null;
}
}
But the result is the same as before:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<!-- hibernate.bug.A cannot be added, no UID found! -->
<hibernate-mapping>
</hibernate-mapping>