jdo

Gae Jdo persistance on one-to-many owned relationship with bidirectional navigation

夙愿已清 提交于 2019-12-10 15:09:06
问题 I'm trying to persist a one-to-many owned relationship with bidirectional navigation in GAE using JDO. I manually add the Contact to User class, and I would expect that in the end the Contact will have a reference to the parent User object. If I configure this manually before I persist the parent, I get an exception: org.datanucleus.store.appengine.DatastoreRelationFieldManager.checkForParentSwitch(DatastoreRelationFieldManager.java:204) After the User object persistence the parent reference

Google Datastore - Problems updating entity

笑着哭i 提交于 2019-12-10 09:53:23
问题 I am dusting off my google app-engine / datastore skills ... and getting stuck on something very simple. As per the example on the GAE documentation I am trying to update an entity as follows: // persistence and business logic PersistenceManager pm = PMF.get().getPersistenceManager(); // get it NickName n = pm.getObjectById(NickName.class, nicknameId); // update fields n.givenName = "new name"; n.nickName = "new nickname"; n.timeStamp = new Date(); // close manager to persist changes pm.close

Trying to run Enhance on Android Studio

一曲冷凌霜 提交于 2019-12-09 13:38:11
问题 I'm trying to setup jdo/jpa in Android Studio and havefollowed an answer from a previous question here. When I attempt to run the enhance task I get: Error:Execution failed for task ':backend:appengineEnhance'. An error occurred enhancing DataNucleus classes. and the log file shows: java.lang.RuntimeException: Unexpected exception at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:76) at com.google.appengine.tools.enhancer.Enhance.<init>(Enhance.java:71) at com.google

jdo/OSGi: error building JDO PersistenceManagerFactory after bundle update

帅比萌擦擦* 提交于 2019-12-08 11:06:09
问题 I'm using JDO with datanucleus-mongodb 3.2.3 and spring 3.0.7 on top of karaf 2.2.10. On a fresh OSGi bundle install I'm able to persist on mongodb without issues, but after a bundle reinstall, I get the following error while building a new JDO PersistenceManagerFactory: ERROR: Bundle [my_bundle] [242] Unable to get module class path. (java.lang.IllegalStateException: zip file closed) Where the ID (242) refers to the first assigned ID to the bundle (in other words, the ID of the old bundle).

cannot fetch image data in gwt google datastore - image is strected out

点点圈 提交于 2019-12-08 09:37:39
问题 I have a class in which I have decrlared a serialized class to store image data @Persistent(serialized = "true") private DownloadableFile imageLogoFile; Implementation of the class public class DownloadableFile implements Serializable { public DownloadableFile(byte[] content, String filename, String mimeType) { super(); this.content = content; this.filename = filename; this.mimeType = mimeType; } private static final long serialVersionUID = -8497358622042084708L; private byte[] content;

Google App Engine and SQL LIKE

时光怂恿深爱的人放手 提交于 2019-12-08 08:09:42
问题 Is there any way to query GAE datastore with filter similar to SQL LIKE statement? For example, if a class has a string field, and I want to find all classes that have some specific keyword in that string, how can I do that? It looks like JDOQL's matches() don't work... Am I missing something? Any comments, links or code fragments are welcome 回答1: As the GAE/J docs say, BigTable doesn't have such native support. You can use JDOQL String.matches for "something%" (i.e startsWith). That's all

Updating objects in GAE

拥有回忆 提交于 2019-12-07 20:37:07
问题 I have a problem that I can't be able to solve. I've tried to search on the web for solutions, but I didn't find any generic solution. I want to update an object, whatever it's class may be, in the datastore. For that, here's the code I'm using for the project I'm using DataNucleus and Google AppEngine. Here's my jdoconfig.xml <?xml version="1.0" encoding="utf-8"?> <jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi

Problems while saving a pre-persisted object in Google App Engine (Java)

别等时光非礼了梦想. 提交于 2019-12-07 17:35:15
问题 I am having problems while saving a pre-persisted JDO object in google-app-engine data store. Basically, in one servlet, I create the object and save it. In another servlet, I read the object, set a bunch of properties and try updating it. The update is through a makePersistent call on PersistenceManager . There is no exception being thrown and no warning logs. However, when I access the same object later, its still in its original state. The PersistenceManager is never closed between the

full-text search using Google App Engine and JDO?

一个人想着一个人 提交于 2019-12-07 05:30:02
问题 I'm using Google App Engine (Java) with JDO. How can I do the JDO equivalent of select * from table where field like '%foo%' The only recommendation I have seen so far is to use Lucene. I'm kind of surprised that something this basic is not possible on out-of-the-box GAE. 回答1: You can't do substring searches of that sort on App Engine. The reason for this is that the App Engine datastore is built to be scalable, and refuses to execute any query it can't satisfy with an index. Indexing a query

Google App Engine and SQL LIKE

僤鯓⒐⒋嵵緔 提交于 2019-12-07 00:18:25
Is there any way to query GAE datastore with filter similar to SQL LIKE statement? For example, if a class has a string field, and I want to find all classes that have some specific keyword in that string, how can I do that? It looks like JDOQL's matches() don't work... Am I missing something? Any comments, links or code fragments are welcome As the GAE/J docs say, BigTable doesn't have such native support. You can use JDOQL String.matches for "something%" (i.e startsWith). That's all there is. Evaluate it in-memory otherwise. If you have a lot of items to examine you want to avoid loading