Questions tagged [activejdbc]

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

215 questions
0
votes
1 answer

deleteAll doesn't work with foreign keys to other rows in same table

I have a Model class that has an attribute referencing another instance of the same Model class. Its basically a tree structure in one Model. When I try to exectute MyModel.deleteAll() it fails because a foreign key constraint fails. Is there…
evan.leonard
  • 989
  • 2
  • 8
  • 10
0
votes
2 answers

Activeweb java version

does Activeweb really need to be java 1.8? I'd like to be able to use App Engine's standard edition[1], but it only supports java 1.7. I'm quite behind on activeweb development, so would appreciate understanding the need for 1.8 at least. Thanks!
evan.leonard
  • 989
  • 2
  • 8
  • 10
0
votes
3 answers

How to access particular element in list in java

I am looping a list to get particular ids off the list array: This is list I am looping: for(int i =0 ;i
kittu
  • 6,662
  • 21
  • 91
  • 185
0
votes
1 answer

ActiveJDBC UniquenessValidator on non-persisted objects

I have the following model: Car ( id INT(11) NOT NULL AUTO_INCREMENT, name TEXT ) .. public class Car extends Model { static{ validatePresenceOf("name"); validateWith(new UniquenessValidator("name")); } public…
TGI
  • 559
  • 1
  • 6
  • 15
0
votes
1 answer

In activeJDBC, how to enforce the presence of a one-to-many relationship to a model

Assuming I have the following DB model: Car( id INT plaque_id INT ) Plaque( id INT identification TEXT ) So in ActiveJDBC, my models are: public class Car extends Model { static{ …
TGI
  • 559
  • 1
  • 6
  • 15
0
votes
1 answer

Debugging ActiveJDBC with IntelliJ IDEA

I am new to ActiveJDBC. I am trying to debug the sample project. The code I want to debug is: public static void main(String[] args) { Base.open(); Person director = new Person("Stephen Spielberg"); director.saveIt(); //[break…
TGI
  • 559
  • 1
  • 6
  • 15
0
votes
1 answer

Unable to deploy javalite on heroku

I have my procfile: web: java -cp target/classes:target/dependency/* com.888.888.Application Connection details: Base.open("com.mysql.jdbc.Driver", "jdbc:mysql://o3iyl77734btg.cbetxkdyhwsb.us-east-1.rds.amazonaws.com/lt9vgms3ueidoa",…
kittu
  • 6,662
  • 21
  • 91
  • 185
0
votes
2 answers

Unable to use database properties file in JavaLite

Could not load database properties file. I have my database.properties file in class path resources folder and I have configured activejdbc.properties at root of classpathenv.connections.file=MyProject/src/main/resources/database.properties I am…
kittu
  • 6,662
  • 21
  • 91
  • 185
0
votes
1 answer
0
votes
2 answers

How do I save values submitted from form in activejdbc?

@Override public Long createPost(Request request) { Base.open(); ObjectMapper mapper = new ObjectMapper(); try { Post newPost = mapper.readValue(request.body(), Post.class); // Map values = ... initialize map // …
kittu
  • 6,662
  • 21
  • 91
  • 185
0
votes
1 answer

ActiveJDBC in a big project

I am using old good Hibernate and reading about news int ORM area. ActiveJDBC seems to be quite new ORM, does anybody use it in a big project? Where Hibernate is stronger and why? What ActiveJDBC is misisng? Does it for example have L1 cache and…
michealAtmi
  • 1,012
  • 2
  • 14
  • 36
0
votes
1 answer

I got this error quite often: org.javalite.activejdbc.DBException: Cannot open a new connection

I got this error when I leave a page 10 minutes and then refresh or when I refresh a page multiple times quickly (a page where the controller launches a query of course). Tahe same error as here: https://github.com/javalite/activejdbc/issues/268 I…
Rony
  • 101
  • 1
  • 8
0
votes
1 answer

Trigger query with ActiveJdbc in controller

I'm running a query using ActiveJdbc List games = District.findAll("where createor_id = ?", creatorId); And according o the documentation the query is triggered when I do this for (Game game : games) { //do things with result …
Rony
  • 101
  • 1
  • 8
0
votes
1 answer

Can I put different parts of a Javalite project in separate Maven repos?

In my Javalite project, I have my models, controllers, config files and other classes. I want to reuse some of the parts in this project since in my other Javalite projects, I want to use the same models but I don't want to simply copy-paste or…
halileohalilei
  • 2,220
  • 2
  • 25
  • 52
0
votes
2 answers

ActiveJDBC, MySQL and null timestamp producing SQLException

I'm having trouble reading a Model from db using ActiveJDBC. Basically, i'm doing ModelClass.findFirst(...) and a SQLException pops up. There seem to be no problems if the timestamp field is non-zero. Said Model has a mysql timestamp (tried also…
Hitunen
  • 11
  • 2