findEntityByName method

ModelEntity? findEntityByName(
  1. String name
)

Implementation

ModelEntity? findEntityByName(String name) {
  final found = entities
      .where((e) => e.name.toLowerCase() == name.toLowerCase())
      .toList();
  if (found.isEmpty) return null;
  if (found.length >= 2) {
    throw StateError(
        'ambiguous entity name: $name; please specify a UID in its annotation');
  }
  return found[0];
}