getEntityDefinition static method

Entity getEntityDefinition(
  1. ClassMirror entityClassMirror
)

Implementation

static Entity getEntityDefinition(ClassMirror entityClassMirror) {
  Entity? entity = entityClassMirror.metadata[1] is Entity
      ? entityClassMirror.metadata[1] as Entity
      : null;

  return Entity(
      tableName: entity?.tableName ?? entityClassMirror.simpleName,
      apiResourceName:
          entity?.apiResourceName ?? entityClassMirror.simpleName,
      classMirror: entityClassMirror,
      options: entity != null ? entity.options : null);
}