datanucleus

Persisting @ElementCollection of @Embeddable (Google App Engine, datanucleus)

送分小仙女□ 提交于 2019-12-08 11:29:51
问题 I am trying to persist a JPA entity with a collection of custom @Embeddable objects using the JPA2 @ElementCollection annotation. Simple example (both classes are enhanced by datanucleus): @Entity public class TestEntity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @ElementCollection private Set<TestEmbeddable> testEmbeddables; public Set<TestEmbeddable> testEmbeddables() { return this.testEmbeddables; } } @Embeddable public class TestEmbeddable implements

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).

gradlew :appengineEnhance fails

牧云@^-^@ 提交于 2019-12-07 22:50:15
问题 I am creating a mobile backend in Java using Google App Engine with Android Studio . In order to start the local server exposing my API, I use gradlew [module name]:appengineRun . However, when I go to http://localhost:8080/_ah/api/explorer , and try to use the API I get the following error: apr 29, 2014 10:52:32 PM com.google.api.server.spi.SystemService invokeServiceMethod SEVERE: The class "com.mthoresen.fest.backend.LocationBean" is not persistable. This means that it either hasnt been

GAE, JPA, XG-transactions, too many entity groups exception

廉价感情. 提交于 2019-12-07 22:28:44
问题 I know there is limit of 5 entity groups in XG-transaction on GAE but I think I am using only 3 groups(Commodity, Category, CommodityCategory) in one transaction and still getting this exception: Caused by: java.lang.IllegalArgumentException: operating on too many entity groups in a single transaction. Here are vital parts of code of my datamodel and dao: Category model @Entity(name = "Category") public class Category extends BaseDatastoreEntity{ private String name; private Key parentKey;

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

Defining database independent JPA object uid

独自空忆成欢 提交于 2019-12-06 10:49:25
问题 It turns out that the following example works when using mysql 5.x, however it doesn't when using an oracle 10g database. Is there a way to define a unique identifier field that is independent of the database technology? @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name="id") private long id; I have tested this in hibernate and the following exception occurs only when using Oracle: org.hibernate.MappingException: Dialect does not support identity key generation 回答1: Using a

example using memcache with jpa entitymanager on JGAE?

强颜欢笑 提交于 2019-12-06 08:49:32
any example on using memcache/general cache with jpa entitymanager on JGAE? or the only way to do it is manually put/set memcache on service layer? DataNucleus docs define adequately how to use the JDO/JPA L2 cache. http://www.datanucleus.org/products/accessplatform_1_1/jpa/cache.html in the case of GAE/J memcache the L2 cache should be "javax.cache". 来源: https://stackoverflow.com/questions/1978428/example-using-memcache-with-jpa-entitymanager-on-jgae

datanucleus enhancer & javaw: “the parameter is incorrect”

二次信任 提交于 2019-12-06 05:17:54
问题 I'm on windows XP using eclipse and the datanucleus enhancer for a gwt + gae app. When I run the enhancer, I get an error: Error Thu Oct 21 16:33:57 CDT 2010 Cannot run program "C:\Program Files\Java\jdk1.6.0_18\bin\javaw.exe" (in directory "C:\ag\dev"): CreateProcess error=87, The parameter is incorrect java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.6.0_18\bin\javaw.exe" (in directory "C:\ag\dev"): CreateProcess error=87, The parameter is incorrect at java.lang

Add scala class to DataNucleus enhancer CLASSPATH

巧了我就是萌 提交于 2019-12-06 04:39:31
I am writing a Google App Engine web app and wish to use Scala on the server side. I'm using Eclipse and the Google App Engine plugin. However, as soon as I add an empty Scala class source file to my project, the DataNucleus enhancer warns: SEVERE: Class "com.my.package.UserAccount" was not found in the CLASSPATH. Please check your specification and your CLASSPATH. I will eventually get round to making the class persistent but I want to get rid of this error first. So far I've added the Scala Nature, and have tried cleaning the project and also restarting Eclipse but I always get the same

How can I run DataNucleus Bytecode Enhancer from SBT?

◇◆丶佛笑我妖孽 提交于 2019-12-06 03:33:12
I've put together a proof of concept which aims to provide a skeleton SBT multimodule project which utilizes DataNucleus JDO Enhancer with mixed Java and Scala sources. The difficulty appears when I try to enhance persistence classes from SBT. Apparently, I'm not passing the correct classpath when calling Fork.java.fork(...) from SBT. See also this question: How can SBT generate metamodel classes from model classes using DataNucleus? Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.datanucleus.util.Localiser at org.datanucleus.metadata