How can allow multiple null value in a Unique column.


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.



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