Spring Hibernate Errors and Solutions
Problem: Hibernate Gives an Error for updating a column with a null value this column is a foreign key Entity X has a resource in it @JoinColumn(name = "resource_id", referencedColumnName = "id") @ManyToOne(optional = false) private Resource resource; not-null-property-references-a-null-or-transient-value When the resource is null when we try to update in Hibernate 4.2.2 Final a error is given in Nullability.class if ( checkability[i] && values[i]!= LazyPropertyInitializer.UNFETCHED_PROPERTY ) { final Object value = values[i]; if ( !nullability[i] && value == null ) { //check basic level one nullablilty throw new PropertyValueException( "not-null property references a null or transient value", persister.getEntityName(), persister.getPropertyNames()[i] ); } Solution: Set @ManyToOne(opti...