How can I make a complex query with ActiveJDBC?
I have a model Student
and a model Class
Student:
id
first_name
last_name
Class:
id
name
student_id
I'm given two student ids 1 and 50 for example
I want to get all the classes such that the student id is between 1 and 50 and such that the first name matches "Dan"
I know I can do the following to get the list of classes between student id [1 - 50]:
List<Class> classesList = Class.where("student_id >= ? and student_id <= ?", firstStudent.getId(), SecondStudent.getId());
but then how I do restrict the student name?
I also have requirements to make more complex queries (specially with many-to-many models) but I'm not sure how to get around it with ActiveJDBC