簡單條件查詢
- 查詢方法必須以find|read|get開頭,
- 涉及條件查詢時,條件的屬性同條件之間用關鍵字連接,條件屬性首字母大寫
支持屬性級聯查詢,噹噹前類又符合條件的屬性時,優先使用當前類屬性,而不使用級聯屬性;若需要使用級聯屬性 屬性之間使用_連接
支持的關鍵字如下
- 實列展示
//where name like ?% and id < ?
List<Person> getByNameStartingWithAndIdLessThan(String Name, Integer id);
// where email in(?,?,?) or birth <?;
List<Person> getByEmailInOrBrithLessThan(List<String> email ,Date date);
//where a.id > ? 級聯屬性的id(新的實體)
List<Person> getByAddressIdGreaterThan(Integer id);
PS: 進行相關測試即可 ,可參照上一節測試例子