Hello,
I have the following problem. I have an entity with @Id property thats its not Generated by
Hibernate (its an user input). For some reason, my entity its not persisted when i call a save action.
If i put this same entity to have a generated value (@GeneratedValue) its work like it should.
Do you some idea what is it?
Im using hibernate 4.1.1.Final (Tested with 4.0.0.Final too) and Spring 3.1.
I tryed it first on Postgres 8.4 and now on DB2 and same behavior.
Code:
public class FormaArrecadacao {
@Id
@Column(name = "CFMARRCODI", length = 1, unique = true, nullable = false)
private String id;
}
public class FormaDAO ..{
@Override
public FormaArrecadacao incluir(final FormaArrecadacao entity) {
getSession().save(entity);
return entity;
}
}
And yes.. im using @Transactional on my methods on Controller.
Any clues?