Skip to content

@Query

Command method extension

Query methods used for queries (select/update/insert).

Select query:

@Query("select from Model where name=?")
List<Model> select(String name)

Update query:

@Query("update Model set name = ? where name = ?")
int update(String to, String from)
Update query return type could be void, int, long, Integer and Long.

Insert query:

@Query("insert into Model (name) values (?)")
Model insert(String name)
Internally OSQLSynchQuery used for selects and OCommandSQL for updates and inserts.

Documentation links: