Skip to content

SQL Select

xcesco edited this page Apr 26, 2018 · 11 revisions

Given a Dao interface definition, it is possible to define a SQL SELECT operation by method's definition annotated by @BindSqlSelect annotation. An example:

@BindDao(CollegeStudent.class)
public interface CollegeStudentDao {
  // retrieve all student
  @BindSqlSelect(orderBy="name")
  List<CollegeStudent> getAllStudents();

  // retrieve all student from table student
  @BindSqlSelect(orderBy="name")
  List<CollegeStudent> getAllStudents();

  // retrieve all student from table student
  @BindSqlSelect
  ArrayList<CollegeStudent> getAllStudents();

  // select student by id
  @BindSqlSelect(where="id=${uid}")
  Student getStudent(int uid);
}

Table of Contents

Query definition

Features

Relations

Multithread supports

Modularization

Annotations for data convertion

Annotations for SQLite ORM

Annotations for shared preferences

Clone this wiki locally