persistence@glassfish.java.net

Basic.optional() vs. Column.nullable()

From: Andrei Badea <Andrei.Badea_at_Sun.COM>
Date: Mon, 26 Feb 2007 13:48:13 +0100

What is exactly the difference between Basic.optional() and
Column.nullable()? For example, does

@Basic(optional = false)
public int getAge() { ... }

mean the same as

@Column(nullable = false)
public int getAge() { ... }

wrt database column nullability? I know the spec says optional() is a
hint, but what should an implementation do if it decided not to ignore
it? IOW, what was the reason to have both nullable() and optional() in
the spec?

Thanks,

Andrei