jdo

Unable to get ID of newly-created JDO persistent entity using GAE/J DataNucleus plug-in version 2.1.2

谁都会走 提交于 2019-12-04 10:30:01
My problem I am porting my application from version 1.x to 2.0 of the DataNucleus plug-in for GAE/J using the new 1.7.5 GAE/J SDK. This changes my JDO version from 2.3 to 3.0.1. My persistent entity class has a primary key of type encoded string, along with read-only access to the object’s numeric ID. Each instance is the sole member of its entity group (children and parent are linked by numeric ID only). Previously, I have been able to create and persist a new MyEntity instance and then immediately access its numeric ID to store in the parent MyEntity instance’s list of child IDs. Now I find

How to dynamically build JDO Queries on multiple parameters

北慕城南 提交于 2019-12-04 10:16:49
One can easily use JDO syntax to query on multiple parameters as follows: //specify the persistent entity you're querying and you filter usign params query = pm.newQuery(MyClass.class, " customer == paramCustomer && date >= paramStartDate && date <=paramEndDate "); // declare params used above query.declareParameters("com.google.appengine.api.users.User paramCustomer, java.util.Date paramStartDate, java.util.Date paramEndDate"); //pass the object declared as params MyClassList = (List<MyClass>) query.execute(user, startDate, endDate); It's straightforward to programmatically build a string

Inconsistent Fetch From Google App Engine Datastore

回眸只為那壹抹淺笑 提交于 2019-12-04 05:48:11
I have an application deployed in Google app engine. I am getting inconsistent data when i fetch an entity by id immediately after updating that entity. I'm using JDO 3.0 to access the app engine datastore. I have an entity Employee @PersistenceCapable(detachable = "true") public class Employee implements Serializable { /** * */ private static final long serialVersionUID = -8319851654750418424L; @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY, defaultFetchGroup = "true") @Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true") private String id;

XSD Schema - JAXB marshaling - Datastore(JPA/JDO) Roundtrip

孤者浪人 提交于 2019-12-03 20:16:14
问题 I'm trying to find a way to accomplish a xsd schema to datastore roundtrip, with minimum effort. I used jaxb to build my object model from schemas, now I would like to store these objects based on JPA (or JDO or something else?). Is it possible, to auto enhance the objects with the missing annotations based on the JAXB Annotations? Is it desirable? Thanks 回答1: You have several options for this use case. Option #1 - Hyperjaxb3 I have not used this myself, but Hyperjaxb3 is supposed to generate

Trying to run Enhance on Android Studio

被刻印的时光 ゝ 提交于 2019-12-03 17:18:04
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.appengine.tools.enhancer.Enhance.main(Enhance.java:51) Caused by: java.lang.reflect

Transactions over very very large entity group

*爱你&永不变心* 提交于 2019-12-03 13:40:48
问题 I am trying to design a data model which can hold a very large amount of data, does anyone with experience in large volumes of data have any feedback on this, ie: // example only, not meant to compile public class TransactionAccount { private long balance; private List<Transaction> transactions = new ArrayList<Transaction>(); .... public long getBalance() { return balance; } } private class Transaction { public Date date; public long amount; } Based on what I have read, the only way to get

Transactions over very very large entity group

天大地大妈咪最大 提交于 2019-12-03 03:38:28
I am trying to design a data model which can hold a very large amount of data, does anyone with experience in large volumes of data have any feedback on this, ie: // example only, not meant to compile public class TransactionAccount { private long balance; private List<Transaction> transactions = new ArrayList<Transaction>(); .... public long getBalance() { return balance; } } private class Transaction { public Date date; public long amount; } Based on what I have read, the only way to get transactional integrity on inserting a Transaction and updating balance is to make it one entity group.

Why put a DAO layer over a persistence layer (like JDO or Hibernate)

我是研究僧i 提交于 2019-12-02 17:05:26
Data Access Objects (DAOs) are a common design pattern, and recommended by Sun. But the earliest examples of Java DAOs interacted directly with relational databases -- they were, in essence, doing object-relational mapping (ORM). Nowadays, I see DAOs on top of mature ORM frameworks like JDO and Hibernate, and I wonder if that is really a good idea. I am developing a web service using JDO as the persistence layer, and am considering whether or not to introduce DAOs. I foresee a problem when dealing with a particular class which contains a map of other objects: public class Book { // Book

Persist List of objects

六月ゝ 毕业季﹏ 提交于 2019-12-02 10:09:55
I got this "javax.jdo.JDOFatalUserException: Error in meta-data for don.Comment.id: Cannot have a java.lang.String primary key and be a child object (owning field is don.Post.comments). NestedThrowables:" when running my grails + app-engine webapp How can I fix this? class Comment.groovy import javax.jdo.annotations.*; @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true") class Comment implements Serializable { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) String id @Persistent(mappedBy="comments") Post post @Persistent String name @Persistent

NullPointerException running DataNucleus Enhancer 3.1.0-release

痞子三分冷 提交于 2019-12-02 01:26:15
问题 I am running DataNucleus enhancer from DOS as follows: java -cp C:\Users\Chania\workspace\myproject\war\WEB-INF\classes\;C:\repo\datanucleus-full-3.1.0-release\lib\datanucleus-enhancer-3.1.0-release.jar;C:\repo\datanucleus-full-3.1.0-release\lib\datanucleus-core-3.1.0-release.jar;C:\repo\datanucleus-full-3.1.0-release\deps\jdo-api-3.1-SNAPSHOT-20110926.jar;C:\repo\datanucleus-full-3.1.0-release\lib\datanucleus-api-jdo-3.1.0-release.jar;C:\repo\datanucleus-full-3.1.0-release\deps\log4j-1.2.14