Hi,
I am using Hibernate 3.1 with hibernate-annotations 3.1b7 (through a spring hibernate3 configuration without the entity manager).
The following code won't run:
Code:
@Entity
public class Person {
private Dog firstDog;
private Dog secondDog;
// getters & setters for the firstDog and SecondDog
}
@Embeddable
public class Dog {
private String dogName;
// getters & setters for dogName
}
It gives me an exception :
Repeated column in mapping for entity: x.y.Person column: dogName
Yet I am using DefaultComponentSafeNamingStrategy, which according to the documentation should solve this problem:
"If you want to have the same embeddeable object type twice in the same entity, the column name defaulting will not work: at least one of the columns will have to be explicit. Hibernate goes beyond the EJB3 spec and allows you to enhance the defaulting mechanism through the NamingStrategy. DefaultComponentSafeNamingStrategy is a small improvement of the default EJB3NamingStrategy that allows embedded objects to be defaulted even if used twice in the same entity."