Hibernate Annotations 3.2.1 GA
I found that the column annotation is sometimes ignored. The reason is that I mixed column annotations targets. I assigned the ID to the field and the other annotations to a method.
If the ID annotation is assigned to a field, further method annotations are ignored and vice versa.
I am not sure if this should be filed as a bug and appreciate feedback on this problem.
Regards Sebastian
Code:
package de.laliluna.annotation;
import java.io.Serializable;
@Entity
public class SimpleBean implements Serializable {
public static void main(String[] args) {
new SchemaExport(new AnnotationConfiguration().configure()).create(true, false);
}
@Id
private Integer id;
private String nameMethod;
@Column(name = "name_field")
private String nameField;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNameField() {
return nameField;
}
public void setNameField(String nameField) {
this.nameField = nameField;
}
@Column(name = "name_method")
public String getNameMethod() {
return nameMethod;
}
public void setNameMethod(String nameMethod) {
this.nameMethod = nameMethod;
}
}
[/code]