users@glassfish.java.net

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

From: Sahoo <Sahoo_at_sun.com>
Date: Thu, 28 Jun 2007 14:45:52 +0530

Your question is answered here:
https://glassfish.dev.java.net/servlets/ReadMsg?list=persistence&msgNo=2917

Thanks,
Sahoo

glassfish_at_javadesktop.org wrote:
> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>