Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用长id查询java appengine数据存储查看器中的实体_Java_Google App Engine_Google Cloud Datastore_Key - Fatal编程技术网

如何使用长id查询java appengine数据存储查看器中的实体

如何使用长id查询java appengine数据存储查看器中的实体,java,google-app-engine,google-cloud-datastore,key,Java,Google App Engine,Google Cloud Datastore,Key,我正在尝试做一些相对简单的事情,一些我认为我过去能够做的事情 我正在尝试使用管理员界面使用长id查询我的数据存储。所涉及的实体定义为: @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true") public class Notification { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.I

我正在尝试做一些相对简单的事情,一些我认为我过去能够做的事情

我正在尝试使用管理员界面使用长id查询我的数据存储。所涉及的实体定义为:

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
public class Notification
{   
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Long notificationId = null;
}
在appengine管理界面的数据存储查看器中,我执行以下gql查询:

SELECT * FROM Notification WHERE _key_ = KEY('Notification', 12345)
SELECT * FROM Notification WHERE id = KEY('Notification', 12345)
SELECT * FROM Notification WHERE notificationId = KEY('Notification', 12345)
SELECT * FROM Notification WHERE notificationId = 12345
这些查询都不会返回任何结果,也不会产生任何错误。我确信这个实体是存在的。其中有一个以前有用,我记不起是哪一个了。这可能是因为appengine最近更新到1.3.6吗?

您需要:

SELECT * FROM Notification WHERE __key__ = KEY('Notification', 12345)
请注意,键周围有两个下划线,而不是一个