users@glassfish.java.net

Re: Constraints not working

From: Gerald Holl <gerald_at_holl.co.at>
Date: Wed, 31 Oct 2007 15:35:54 +0100

Gerald Holl wrote:
> Hi,
>
> Different constraints are not working with the latest Glassfish release.
>
> @Column(nullable = false, unique = true)
> public String getName() {}
>
> Neither the not null constraint nor the unique constraint is created in
> the DB.

Ok, it seems the columnDefinition overwrites all the other constraints:
@Column(nullable = false, unique = true, columnDefinition="nvarchar(255)")

Is this the expected behavior? I don't think so.

cheers,
Gerald