users@glassfish.java.net

Re: Constraints not working

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Wed, 31 Oct 2007 10:03:49 -0700

Gerald Holl wrote:
> 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.

It is. The spec says that it is "Generated SQL to create a column of the inferred
type."

Regards,
-marina

> cheers,
> Gerald
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>