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
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
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.
How can i apply Unique in not null value of a Column?
Eg:
Name : null (allow)
Name : xyx (allow)
Name : null (allow)
Name : abc (allow)
Name : xyz (not allow)
You cannot use unique in this scenario, i.e. it would be your application responsibility to enforce such a constraint.