checkEntityFields method
void
checkEntityFields(
- O o
)
override
Implementation
@override
void checkEntityFields(O o) {
entityHandler.checkAllFieldsValues(o);
var fieldsEntityAnnotations = entityHandler.getAllFieldsEntityAnnotations(
o,
);
var uniques = fieldsEntityAnnotations?.entries
.where((e) => e.value.hasUnique)
.toList();
if (uniques == null || uniques.isEmpty) return;
for (var e in uniques) {
var field = e.key;
var value = getField(o, field);
if (value == null) continue;
if (_containsEntryWithFieldValue(field, value)) {
throw EntityFieldInvalid(
"unique",
value,
fieldName: field,
entityType: type,
tableName: name,
);
}
}
}