Questions tagged [activejdbc]

ActiveJDBC is a Java ORM modeled on ActiveRecord from Ruby on Rails.

215 questions
19
votes
2 answers

Gradle: How to add a custom task after compilation but before packaging files into a Jar?

My build.gradle is currently: project(':rss-middletier') { apply plugin: 'java' dependencies { compile project(':rss-core') compile 'asm:asm-all:3.2' compile 'com.sun.jersey:jersey-server:1.9.1' compile…
Hongyi Li
  • 1,059
  • 2
  • 11
  • 19
5
votes
1 answer

Android. ActiveJDBC possible?

Official web site says that library supports SQLite 3. Android has SQLite. Is it possible to use JavaLite's ActiveJDBC in Android Studio project? Website says that conenction is made like this: Base.open("com.mysql.jdbc.Driver",…
Joe Richard
  • 1,520
  • 7
  • 20
  • 31
5
votes
1 answer

Using ActiveJDBC with multiple threads

I have an application that is built on ActiveJDBC for Database interactions. I'm now in the process of multithreading the thing but I'm running into a couple issues. Whenever I try to get an object from the DB, I get this exception: Cannot open a…
Martijn
  • 2,268
  • 3
  • 25
  • 51
3
votes
1 answer

ActiveJDBC - how to define models

you are trying to work with models, but no models are found. Maybe you have no models in project, or you did not instrument the models. It is expected that you have a file activejdbc_models.properties on classpath Caused by:…
jrey
  • 2,163
  • 1
  • 32
  • 48
3
votes
1 answer

activejdbc include parent recursively

I'm work with activejdbc and: I have 3 Models: City belongs to State belongs to Country, ok? I do this: Paginator p = new Paginator(City.class, count, filters).orderBy(orderParams); LazyList page = p.getPage(pag).include(State.class); This, loads…
pablor21
  • 89
  • 6
3
votes
1 answer

ActiveJDBC: save() generates insert only for auto-generated primary key?

I recently started using ActiveJDBC. I have the following table (postgresql) CREATE TABLE users ( id uuid PRIMARY KEY, email text UNIQUE NOT NULL, password text,
Sharon Ben Asher
  • 13,849
  • 5
  • 33
  • 47
3
votes
1 answer

ActiveJDBC performance

Today I've found some interesting library - ActiveJDBC. It provides RoR-like ActiveRecord interface, and I'm thinking on Hibernate replacement, but there is a question - can ActiveJDBC handle really big queries and results and is it clever to use it…
skayred
  • 10,603
  • 10
  • 52
  • 94
2
votes
2 answers

Mock findAll() method in ActiveJDBC for unit testing

I am using ActiveJDBC in my project which has a model ScriptRule. Please find the attached code snippet. public class RuleEvaluatorProvider { public static RuleEvaluatorClient getRuleEvaluatorClient() throws ScriptException, IOException { …
frugalcoder
  • 959
  • 2
  • 11
  • 23
2
votes
1 answer

Multiple tables with same model

I am using Active JDBC. I have a use case where I wanted to read from table_date on any given date where the structure/model of the table will be same for all the tables of this type. eg: registrations_29_10_2015, registrations_10_11_2015, etc..…
2
votes
2 answers

ActiveJDBC insert without prepared statement

I'm trying to use ActiveJDBC with a DB whose driver does not support the Connection.prepareStatement(String, String[]) method. I'm getting the following exception when trying to insert: org.javalite.activejdbc.DBException:…
gimoh
  • 53
  • 4
2
votes
1 answer

Connection management with ActiveJDBC

I am getting into ActiveJDBC at the moment, a very nice and useful framework, as far as I can tell. But I am having some problems with the JDBC-Connection management of it, as it attaches an opened connection to the current thread. That means, if I…
JonasB
  • 131
  • 1
  • 9
2
votes
1 answer

Where does ActiveJdbc instrumentation compiler take information about database?

If understood correctly, ActiveJdbc compiler should take as input hollow class like this public class Employee extends Model {} and fill it with some code from database metadata. But how can it know where database is located? I found only one place…
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385
2
votes
1 answer

How do you use a Connection Pool with ActiveJDBC instead of just Base.open & close everytime?

Right now I'm just writing methods that does Base.open(), do some operation, and then Base.close(). However, this is extremely inefficient especially when lots of these method calls are made, so I'd like to use some kind of connection pool with…
Hongyi Li
  • 1,059
  • 2
  • 11
  • 19
2
votes
1 answer

Cannot insert object to database with ActiveJDBC

I'm trying to use ActiveJDBC with HSQLDB: Base.open("org.hsqldb.jdbc.JDBCDriver", "jdbc:hsqldb:file:queen-db;shutdown=true;hsqldb.write_delay=false;", "sa", ""); User e = new User(); e.set("id", 1); e.set("nickname", "Superman"); …
skayred
  • 10,603
  • 10
  • 52
  • 94
1
vote
2 answers

Unable to Eager load children using getAll(..)

We are trying to query Child records eagerly by defining @HasMany relationship and by using include() as mentioned here: Lazy and Eager Table Structure: Parent(id, name); Child(id, name, parent_id); Parent Class: @HasMany(foreignKeyName =…
Pratap R
  • 31
  • 4
1
2 3
14 15