How can allow multiple null value in a Unique column.

#1

I have a entity Person have 2 fields Name(Unique) and PhoneNumbers. I wants to allow null value for name.How can i achieve this?

 

I have attach my entity class for your reference.

Thanks 

#2

ObjectDB considers a null value as any other value, so indeed, for a unique field you cannot have more than one null value. If you need multiple null values then the field should not be defined as unique.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login