process method

  1. @override
Dao process()
override

Implementation

@override
Dao process() {
  final name = _classElement.displayName;
  final methods = [
    ..._classElement.methods,
    ..._classElement.allSupertypes.expand((type) => type.methods)
  ];

  final typeConverters = _typeConverters +
      _classElement.getTypeConverters(TypeConverterScope.dao);

  final queryMethods = _getQueryMethods(methods, typeConverters);
  final insertionMethods = _getInsertionMethods(methods);
  final updateMethods = _getUpdateMethods(methods);
  final deletionMethods = _getDeletionMethods(methods);
  final transactionMethods = _getTransactionMethods(methods);

  final streamQueryables = queryMethods
      .where((method) => method.returnsStream)
      .map((method) => method.queryable);
  final streamEntities = streamQueryables.whereType<Entity>().toSet();
  final streamViews = streamQueryables.whereType<View>().toSet();

  return Dao(
    _classElement,
    name,
    queryMethods,
    insertionMethods,
    updateMethods,
    deletionMethods,
    transactionMethods,
    streamEntities,
    streamViews,
    typeConverters,
  );
}