- import java.util.regex.Pattern;
- import com.google.code.morphia.query.Query;
- ...
- Datastore ds;
- Query query = ds.createQuery(Person.class );
- Pattern pattern = Pattern.compile("^.*" + personName+ ".*$" , // as SQL: like " '%" + personName + "%' "
- Pattern.CASE_INSENSITIVE);
- query.filter("name" , pattern);
- List<Persion> persons = query.asList();
morphia
最新推荐文章于 2021-03-17 00:05:50 发布