question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extends class from module

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
naeemscommented, Aug 16, 2016

@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

0reactions
BuilovAlexeycommented, Dec 20, 2017

Captain obvious, I need exactly what I asked in this issue

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found