云端点文本字段支持超过500个字符 [英] Cloud Endpoints support for text fields with more than 500 characters

查看:109
本文介绍了云端点文本字段支持超过500个字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要存储领域,通常是超过500个字符。当使用字符串数据类型,App Engine将失败,并建议使用com.google.appengine.api.datastore.Text数据类型在这种情况下。

I need to store a field that is usually over 500 characters. When using the String data type, App Engine fails and suggests to use the com.google.appengine.api.datastore.Text datatype in this case.

在这样做时,Android客户端失败,以下内容:

When doing so, the Android client fails with the following:

AndroidRuntime标签:java.lang.IllegalArgumentException异常:通过而引起的原始类,但得到的答案:类com.sample.sampleproj.sampleendpoint.model.Text在com.google.api.client.util.Data.parsePrimitiveValue(数据的.java:4 53)

AndroidRuntime tag: Caused by: java.lang.IllegalArgumentException: expected primitive class, but got: class com.sample.sampleproj.sampleendpoint.model.Text at com.google.api.client.util.Data.parsePrimitiveValue(Data.java:4 53)

如何能超过500个字符的字符串值存储在App Engine和由云端点支持?

How can string values greater than 500 characters be stored in App Engine and supported by the Cloud Endpoint?

推荐答案

有被doccumented限制的数据存储 - 500个字符弦乐。您可以通过使用文本绕过它(或没有索引的字符串,因为文字是pcated我相信德$ P $)。但是,这只是涵盖了从数据存储中保存/读取数据。

There is doccumented limitation to Datastore - 500 characters for String. You can bypass it by using Text (or unindexed String, since Text is deprecated I believe). But this just covers saving/reading data from datastore.

有对端点方法单一参数的500个字符的限制无证。这意味着,如果你把一些objct的方法,序列化之后需要更多的空间比500个字符的方法将失败。

There is undocumented limitation of 500 chars to endpoint method single param. This mean if you send some objct to the method, which after serialization takes more space than 500 chars the method will fail.

我用一个servlet做绕过它。见我的问题<一href=\"http://stackoverflow.com/questions/23942383/the-string-property-has-a-value-that-is-too-long-it-cannot-exceed-500-character\">here

I did bypass it by using a servlet. See my question here

这篇关于云端点文本字段支持超过500个字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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