To follow up, here is an updated script, without tests (since they fail), without the unique constraint (since is not supported), and I've written a couple of Groovy scripts to change a version of an artifact in the pom (pomVersions) and to remove an artifact from the pom (pomRm). In this way I can express the whole thing in a script that can be copied and pasted in the console:
Code:
mkdir test-gae
cd test-gae
roo
project --topLevelPackage com.ciaobit --java 6
jpa setup --database GOOGLE_APP_ENGINE --provider DATANUCLEUS --applicationId appotest
entity jpa --class ~.domain.App --activeRecord false
field string --fieldName appName --sizeMin 3 --sizeMax 48 --regexp ^[0-9a-zA-Z-]+$ --notNull
field string --fieldName email --regexp ^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$ --notNull
repository jpa --interface ~.repository.AppRepository --entity ~.domain.App
service --interface ~.service.AppService --entity ~.domain.App
web mvc setup
web mvc all --package ~.webproto
perform eclipse
exit
pomVersions datanucleus-core 3.0.7
pomVersions datanucleus-api-jpa 3.0.6
pomRm datanucleus-rdbms rm
mvn gae:run
It's improved, now I can create a new item, modify it. The modification works in the datastore, but the interface shows the old value, even after multiple refreshes. If instead I go to List All, it dies with an exception:
Code:
java.util.ArrayList$Itr.next(ArrayList.java:794)
org.datanucleus.api.jpa.criteria.CriteriaQueryImpl.toString(CriteriaQueryImpl.java:758)
org.datanucleus.api.jpa.JPAEntityManager.createQuery(JPAEntityManager.java:771)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:601)
com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:100)
org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:365)
$Proxy29.createQuery(Unknown Source)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:601)
com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:100)
org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240)
$Proxy29.createQuery(Unknown Source)
org.springframework.data.jpa.repository.support.SimpleJpaRepository.getQuery(SimpleJpaRepository.java:420)
org.springframework.data.jpa.repository.support.SimpleJpaRepository.findAll(SimpleJpaRepository.java:277)
org.springframework.data.jpa.repository.support.SimpleJpaRepository.findAll(SimpleJpaRepository.java:239)
So, I've to give up with roo and spring-data.
Regards,
stivlo