gpt4 book ai didi

google-app-engine - Google App Engine : Objectify lib 3. 1 不包括 com.googlecode.objectify.annotation.Id 注释?

转载 作者:太空宇宙 更新时间:2023-11-03 15:35:38 28 4
gpt4 key购买 nike

我从 http://code.google.com/p/objectify-appengine/downloads/list 下载了 Objectify 3.1 库,当我遵循指南时,他们说我应该用 @Id 和 @Index 注释我的 @Entity 对象,但这些根本不包含在库中!

我的 com.googlecode.objectify.annotation 包只包含这些注释:

  • com.googlecode.objectify.annotation.AlsoLoad.class
  • com.googlecode.objectify.annotation.Cached.class
  • com.googlecode.objectify.annotation.Entity.class
  • com.googlecode.objectify.annotation.Indexed.class
  • com.googlecode.objectify.annotation.NotSaved.class
  • com.googlecode.objectify.annotation.Parent.class
  • com.googlecode.objectify.annotation.Serialized.class
  • com.googlecode.objectify.annotation.Subclass.class
  • com.googlecode.objectify.annotation.Unindexed.class

求助!谢谢!

最佳答案

Objectify 3.1 使用 javax.persistence.Id,而不是其自身包内的 Id 注释。我认为这样做的理由是应该使用标准注释而不是特定于库的注释。无论如何,Objectify 4(它有很多非常好的改进)在 jar 中定义了 Id 注释......我怀疑是因为你的问题并不罕见。

关于google-app-engine - Google App Engine : Objectify lib 3. 1 不包括 com.googlecode.objectify.annotation.Id 注释?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12716107/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com