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

Dao class is not generated properly with its base class #258

Closed
tulioccalazans opened this issue Feb 13, 2020 · 0 comments · Fixed by #281
Closed

Dao class is not generated properly with its base class #258

tulioccalazans opened this issue Feb 13, 2020 · 0 comments · Fixed by #281

Comments

@tulioccalazans
Copy link

tulioccalazans commented Feb 13, 2020

Hi, I created a base class to have some basic functions for all my Dao classes like that:

abstract class BaseDao<T> {  

  @Insert(onConflict: OnConflictStrategy.REPLACE)  
  Future<int> insert(T obj);  

  @Insert(onConflict: OnConflictStrategy.REPLACE)  
  Future<List<int>> insertAll(List<T> registers);  

  @Update()  
  Future<void> update(T obj);  

  @delete  
  Future<void> deleteEntity(T obj);  
}

And I used this class like that:

@dao
abstract class ContactDao extends BaseDao<Contact> {
  // ...
}

But the generated database file doesn't contain the base methods defined on BaseDao.
This kind of inheritance works fine on Android/Room. Can I do that with Floor? How?

If that is not possible, it would be a good feature to be added.
Floor is amazing!!

@tulioccalazans tulioccalazans changed the title The Dao class is not generated properly with its base class Dao class is not generated properly with its base class Feb 13, 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 a pull request may close this issue.

1 participant