null « Version « JPA Q&A





1. hibernate unable to delete @Entity with null @Version    stackoverflow.com

i have a JPA @Entity with an @Id defined as

private UUID id;

@Id
@Column(name = "f_id")
@GeneratedValue(generator = "system-uuid")
@Type(type = "pg-uuid")
public UUID getId() {
    return id;
}
and a @Version field defined ...

2.  tag and null value    forum.hibernate.org

I have a version tag: Everything works fine except on the first update because the column CIV_UPDATE_DT is null. Hibernate throws the Stale Object State Exception even when I pass in a null value for that column. Is there a way around this? thanks, Peter

3. Versioning possible with exisiting null timestamp DB column?    forum.hibernate.org

Is it possible to specify an existing DB timestamp column that contains null values as a versioning field? I have the common case of having a creation date timestamp field that is populated on a row insert, and a last update date field that is set to null during the Initial insert. Last update date is updated during update operations only. ...

4. @Version column null or not null ?    forum.hibernate.org

A version or timestamp property should never be null for a detached instance. Hibernate will detect any instance with a null version or timestamp as transient, irrespective of what other unsaved-value strategies are specified. Declaring a nullable version or timestamp property is an easy way to avoid problems with transitive reattachment in Hibernate. It is especially useful for people using assigned ...