process method

  1. @override
Dao process()
override

Implementation

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

  final typeConverters = Set.of(_typeConverters)
    ..addAll(_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,
  );
}