0

I have a class A that extends the activejdbc.Model class in a common library used in multiple of my projects.

I want to add methods to that class in a project using that library without having to go modify the library (the methods will only be used for this project).

What I did: I created a class B extending class A and added my desired methods.

The problem: When I run JDBC methods such as B.where("foo = ?", bar), I get a List<A> object instead of List<B> which causes ClassCastException in following code.

I tried to run the ActiveJDBC instrumentation in the second project (the one with class B) but it tells me I do not have any ActiveJDBC model.

  • Can you show your code? – TuyenNTA Jun 23 '17 at 23:13
  • Can you please create a simple project that replicates this behavior and push it to Github? it will be easier to help you – ipolevoy Jun 26 '17 at 12:18
  • This is a repo I put in place to demonstrate the issue. https://github.com/PaulSzyller/example-activejdbc-extend In the real project, the common directory would actually be a github submodule. – Paul Szyller Jun 26 '17 at 14:10

0 Answers0