@JoinColumn(nullable=false)

#1

During the evaluation of ObjectDB (We're currently developing with EclipseLink/mysql) I noticed was the following:

  • I marked a @Column as nullable=false
  • Than I tried to save it with the property as null
  • It worked, without any problem, now I have a corrupt dataset. I expected an exception or something (with EclipseLink/mysql I would get at least an exception from the database)
  • Is there a setting, that I have/need to set; to prevent the object from being saved? Or did I do something wrong?

This is an code example:

//bi-directional many-to-one association to AlarmGroup
@ManyToOne
@JoinColumn(name="alarm_group_id", nullable=false)
private AlarmGroup alarmGroup;
#2
ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login