使用Objectify + google appengine进行不区分大小写的过滤器查询 [英] Case insensitive filter query with Objectify + google appengine

查看:113
本文介绍了使用Objectify + google appengine进行不区分大小写的过滤器查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种简单的方法来用Objectify + google appengine(Java)做一个不区分大小写的过滤器查询?基本上这就是我想要做的,除了我需要电子邮件过滤器是不区分大小写的。

Is there an easy way to do a case insensitive filter query with Objectify + google appengine (Java)? Essentially this is what I am trying to do except that I need the filter on email to be case insensitive.

Objectify objectifyService = ObjectifyService.begin();
objectifyService.query(AppUser.class).filter("email", email).get();


推荐答案

您需要将您的电子邮件地址存储在标准化例如,小写字母或大写字母)在数据存储中形成,并对其进行查询。如果您还需要原始未修改的电子邮件地址,则应分开存储这两个地址。

You need to store your email address in a normalized (lowercase or uppercase, for instance) form in the datastore, and query on that. If you also need the original unmodified email address, you should store both separately.

这篇关于使用Objectify + google appengine进行不区分大小写的过滤器查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆