通过云端点进行物化 [英] Objectify with Cloud Endpoints
问题描述
运行endpoints.sh时:
错误:参数化类型
com.googlecode.objectify.Key< MyClass>不支持。
更新: 最有可能的#1 ...我一直有意更新到4.0反正... <由于Objectify的普及,在以前的版本中添加了一种解决方法来支持 I am using appengine cloud endpoints and objectify. I have previously deployed these endpoints before and now I am updating them and it is not working with Objectify. I have moved to a new machine and running latest appengine 1.8.6. Have tried putting objectify in the classpath and that did not work. I know this can work, what am I missing?? When running endpoints.sh: UPDATE:
I went back to my old computer and ran endpoints.sh on same endpoint and it worked fine. Old machine has 1.8.3. I am using objectify 3.1. UPDATE 2:
Updated my old machine to 1.8.6 and get same error as other machine. Leaves 2 possibilities:
1) Endpoints no longer support objectify 3.1
or
2) Endpoints have a bug in most recent version Most likely #1...I've been meaning to update to 4.0 anyways... Because of the popularity of Objectify, a workaround was added in prior releases to support the
这篇关于通过云端点进行物化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
我回到旧电脑并在同一端点上运行endpoints.sh它运行良好。旧机器有1.8.3。我正在使用objectify 3.1。
更新2:
将我的旧机器更新至1.8.6,并获得与其他机器相同的错误。留下两种可能性:
1)端点不再支持客观化3.1
或
2)终端在最新版本中有一个错误
Key
类型,直到提供更通用的解决方案。由于新解决方案可用,解决方法已被删除。现在有两种方法可以解决该问题。
@ApiResourceProperty
注释,这会导致在序列化过程中从对象中省略键。如果您想要简单的解决方案并且无需访问客户端中的密钥,请使用此方法。 添加 @ApiTransformer
注释,它提供了一种兼容机制来序列化/反序列化字段。如果需要访问客户中的密钥(或其代表),请使用此方法。因为这需要编写一个转换器类,所以它比第一个选项更有用。
Error: Parameterized type
com.googlecode.objectify.Key<MyClass> not supported.
Key
type, until a more general solution was available. Because the new solution is available, the workaround has been removed. There are two ways you can now approach the issue with the property.
@ApiResourceProperty
annotation that causes the key to be omitted from your object during serialization. Use this approach if you want a simple solution and don't need access to the key in your clients.@ApiTransformer
annotation that provides a compatible mechanism to serialize/deserialize the field. Use this approach if need access to the key (or a representation of it) in your clients. As this requires writing a transformer class, it is more work than the first option.