jjzjj

objectify

全部标签

java - Objectify 上下文未启动/缺少 ObjectifyFilter

AppEngine(突然)告诉我我的Objectify设置不正确。它之前是有效的,我确实在我的web.xml中有ObjectifyFilter。这是我日志中的完整堆栈跟踪:javax.servlet.ServletContextlog:unavailablejava.lang.IllegalStateException:YouhavenotstartedanObjectifycontext.YouareprobablymissingtheObjectifyFilter.Ifyouarenotrunninginthecontextofanhttprequest,seetheObjecti

java - 对象化关系 : One-to-Many, 我可以有效地做到这一点吗?

我是Objectify的新手,我有一个快速的问题做某事的最佳方式:假设我有一个允许人们发送和接收的应用程序消息(为简单起见考虑电子邮件)。当我的应用程序加载时,我没有想要加载来自每个联系人的每条消息向给定用户发送消息。那将是一种浪费。相反,我想加载用户有消息的所有联系人来自(已读或未读)以便我可以显示联系人列表我的应用程序,当用户点击给定的联系人时,我想加载所有来自该联系人的消息以显示给用户。如果不加载帐户的所有消息,我找不到执行此操作的好方法。我阅读了关于多对一关系的Objectifywiki,但我仍然想不出这样做的好方法不是非常低效。对于objectify网站推荐的方式,我似乎必须

java - 使用 App Engine 存储的字符串的最大长度?

当使用AppEngine存储String字段时:AppEngine生成的String的最大length()是多少?数据存储可以处理吗?另外,如果使用Objectify,这个最大长度是否相同,或者Objectify做了一些影响这个最大长度的处理? 最佳答案 Objectify会自动将超过500个字符的字符串转换为native文本存储。如果要索引字符串,请小心;文本对象未编入索引,因此String>500个字符将未编入索引。 关于java-使用AppEngine存储的字符串的最大长度?,我们

python - 使用 lxml.objectify 测试元素是否存在

使用lxml.objectify测试元素是否存在的标准方法是什么?示例XML:sdfsdfdsfd代码fromlxmlimportetree,objectifywithopen('config.xml')asf:xml=f.read()root=objectify.fromstring(xml)printroot.MyElement1printroot.MyElement17#AttributeError:nosuchchild:MyElement17那么,在特定路径上写东西最简单的解决方案是什么?root.MyElement1.Blah='New'#thisworksbecauseM

python - 如何在 lxml 中解析 XML 时不加载注释

我尝试像这样使用lxml在Python中解析XML文件:objectify.parse(xmlPath,parserWithSchema)但是XML文件可能在奇怪的地方包含注释:Sampletext1.23456是一种在解析前不加载或删除评论的方法吗? 最佳答案 在解析器上设置remove_comments=True(documentation):fromlxmlimportetree,objectifyparser=etree.XMLParser(remove_comments=True)tree=objectify.parse(

android - JsonMappingException : Infinite recursion on OneToMany Relationship in Objectify

为了为Android应用程序提供后端服务,我将GoogleAppEngine与Objectify(4.0.3b)一起使用。在后端我有一个简单的用户实体,它有一个用户列表(friend)作为关系。@EntitypublicclassUser{@IdprivateStringemail;@LoadprivateList>friends=newArrayList>();privateUser(){}publicListgetFriends(){ArrayListfriendList=newArrayList();for(Refref:this.friends){friendList.add(

java - 您什么时候在 Objectify for GAE 中注册类(class)?

所以这可能是个愚蠢的问题,但是你什么时候注册类(class):ObjectifyService.register(User.class);目前,我正在我在其他类中使用的类接口(interface)类的构造函数中执行此操作,以简化专门针对我的应用程序的数据存储的使用。但是,我收到此错误:Attemptedtoregisterkind'User'twice所以,我想我的问题是您在Objectify中注册类(class)的频率和具体时间是多少?谢谢!附言这是我的整个类(class):importjava.security.InvalidKeyException;importjava.secu

python - 将 lxml.objectify 的元素转回 XML

我使用lxml.objectify轻松解析和处理XML文件。出于审计原因,我必须将派生对象与元素的原始XML代码一起保存。root=lxml.objectify.fromstring(self.get_xml_data())fori,eleminenumerate(root.elements):#createnewdatabaseentrybasedonelemelem_obj.source_code=turn_elem_into_xml(elem)我如何实现turn_elem_into_xml? 最佳答案 lxml.etree.t

python - 从 lxml.objectify.ObjectifiedElement 中剥离 python 命名空间属性

这个问题在这里已经有了答案:关闭10年前.PossibleDuplicate:Whenusinglxml,cantheXMLberenderedwithoutnamespaceattributes?如何从lxml.objectify.ObjectifiedElement中去除python属性?示例:In[1]:fromlxmlimportetree,objectifyIn[2]:foo=objectify.Element("foo")In[3]:foo.bar="hi"In[4]:foo.baz=1In[5]:foo.fritz=NoneIn[6]:printetree.tostrin

python - 从 lxml.objectify.ObjectifiedElement 中剥离 python 命名空间属性

这个问题在这里已经有了答案:关闭10年前.PossibleDuplicate:Whenusinglxml,cantheXMLberenderedwithoutnamespaceattributes?如何从lxml.objectify.ObjectifiedElement中去除python属性?示例:In[1]:fromlxmlimportetree,objectifyIn[2]:foo=objectify.Element("foo")In[3]:foo.bar="hi"In[4]:foo.baz=1In[5]:foo.fritz=NoneIn[6]:printetree.tostrin