Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support inherited DAO methods #281

Merged
merged 4 commits into from
Mar 14, 2020
Merged

Conversation

joshuatam
Copy link
Contributor

@joshuatam joshuatam commented Mar 13, 2020

Can support similar implementations:

import 'package:floor/floor.dart';

abstract class BaseDao<T> {
  
  @insert
  Future<int> insertModel(T model);

  @update
  Future<void> updateModel(T model);
}

@dao
abstract class ItemDao extends BaseDao<Item> {
  // Other Queries...
}

Closes #258

@codecov
Copy link

codecov bot commented Mar 13, 2020

Codecov Report

Merging #281 into develop will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #281      +/-   ##
===========================================
+ Coverage    81.27%   81.28%   +0.01%     
===========================================
  Files           51       51              
  Lines         1383     1384       +1     
===========================================
+ Hits          1124     1125       +1     
  Misses         259      259
Flag Coverage Δ
#floor 81.28% <100%> (+0.01%) ⬆️
#floor_generator 80.61% <100%> (+0.01%) ⬆️
Impacted Files Coverage Δ
floor_generator/lib/processor/dao_processor.dart 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 39e3be5...15b00fb. Read the comment docs.

@vitusortner
Copy link
Collaborator

Thanks for your contribution! I've added tests and support for inheriting DAO methods that are defined in interfaces (done by using the implements keyword on a class) and mixins.

@vitusortner vitusortner changed the title Added superclass support at dao_processor Support inherited DAO methods Mar 14, 2020
@vitusortner vitusortner merged commit 4e47af1 into pinchbv:develop Mar 14, 2020
@mqus mqus mentioned this pull request Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Dao class is not generated properly with its base class
2 participants