Jq is a light data access objet using mysql. You just define your data base structure and just use java to access data base. It's recommanded for small project.
- Define Object
@Table(name = "a_persons") // optionnal
class Person {
private long id;
private String test;
}
- Get first a_persons or person according Person is defined with @Table annotation
JQ<Person> jq = new JQ<Person>(Person.class);
Person person = jq.first();
- Get all
JQ<Person> jq = new JQ<Person>(Person.class);
List<Person> persons = jq.list();
- Save or update
JQ<Person> jq = new JQ<Person>(Person.class);
Person person = new Person();
person.setId(25);
person.setName("5555");
jq.save(Person);
- Delete
jq.delete(person);