users@glassfish.java.net

Toplink schema generation: optional = false vs. nullable = false

From: <glassfish_at_javadesktop.org>
Date: Thu, 28 Jun 2007 01:43:53 PDT

I am using TopLink Essentials to generate my db schema. I am wondering what is the difference between the 'optional' in

@OneToOne(cascade = {ALL}, fetch = EAGER, optional = false)

and

@Column(nullable = false).

It seems that the second annotation generated a constraint on the database, while the first does not create a contraint that inhibits a null relation. I would also have expected to get a contraint in the first case.
[Message sent by forum member 'hewagn00' (hewagn00)]

http://forums.java.net/jive/thread.jspa?messageID=224413