Extends class from module
See original GitHub issueI have a module that contains database model with dbflow, and I would like to know if it´s possible to extends my module class model from the app.
module app:
@Table(database = AppDataBase.class)
public class User extends BaseModel {
@PrimaryKey
long id;
@Column
String name;
}
my app:
@Table(database = MyDbNameGeneratedDatabaseHolder.class)
public class CustomUser extends User {
@Column
String email;
}
I´m trying adding to the module
apt {
arguments {
targetModuleName 'MyDbName'
}
}
and in my app that extends from Application:
FlowManager.init(this);
FlowManager.initModule(MyDbNameGeneratedDatabaseHolder.class);
but I get : com.raizlabs.android.dbflow.structure.InvalidDBConfiguration: Table: com.myproject.model.entity.User is not registered with a Database. Did you forget the @Table annotation?
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
What is the difference between "include module" and "extend ...
1) include adds methods, constants, and variables on instances of class A ; extend ...
Read more >Extending Ruby classes - Paweł Dąbrowski
Thanks to modules, we can extend classes more appropriately and flexibly. This article is a dive into the include , extend and prepend ......
Read more >Ruby modules: Include vs Prepend vs Extend - Medium
Modules are one of the most interesting features of Ruby. You can use them to attach specific behavior on your classes, and to...
Read more >extends - JavaScript - MDN Web Docs - Mozilla
The extends keyword is used in class declarations or class expressions to create a class that is a child of another class.
Read more >How To Extend Classes with Angular Component Inheritance
Learn how to use the power of inheritance to extend your Angular components with common functionality.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@agrosner any updates on it. I am using DBFlow 3.1.1, can you please tell me how to achieve following case. I have a scenario in which I am trying to create three library modules i.e LibA, LibB and LibC. LibA has Database class, which will be used by LibB and LibC to create its tables when LibB and C will be initialized. When I try to create a Table in LibB or LibC using Database class of LibA, It gives runtime exception of InvalidDBConfig and I have missed some Annotation.
Please suggest me what to do and how I can use same database in different library modules and modules can define their Tables in that common database.
Thanks
Captain obvious, I need exactly what I asked in this issue