google-app-engine


JDO 1:N issue (retriving data)


I have class to work on PDF
#PersistenceCapable
public class GoogleDrivePDF {
#PrimaryKey
#Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
#Persistent
private String pdfName;
... geter, seter...
}
In order to write and read data, I do like this:
GoogleDrivePDF pdf = new GoogleDrivePDF();
key=KeyFactory.createKey(GoogleDrivePDF.class.getSimpleName(),"0B1IQEoiXFg3IWHhJNEtlMzlvQWs");
pdf.setKey(key);
pdf.setPdfName("NAME");
pm.makePersistent(pdf);
and in order to read:
pdf = pm.getObjectById(GoogleDrivePDF.class, "0B1IQEoiXFg3IWHhJNEtlMzlvQWs1");
Everything works!
Now I will create One: Many realationship.
#PersistenceCapable
public class UsersPDFDocuments {
#PrimaryKey
#Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
#Persistent
private List<GoogleDrivePDF> pdfs;
... seter, geter...
}
and I write to Database:
List <GoogleDrivePDF> pdfFilesDao=...
GoogleDrivePDF pdf = new GoogleDrivePDF();
Key key= KeyFactory.createKey(GoogleDrivePDF.class.getSimpleName(), "0B1IQEoiXFg3IWHhJNEtlMzlvQWs1");
pdf.setKey(key);
pdf.setVerifyed(false);
pdf.setPdfName("mari123");
pdfFilesDao.add(pdf);
key= KeyFactory.createKey(UsersPDFDocuments.class.getSimpleName(), "mail#mail");
UsersPDFDocuments userData = new UsersPDFDocuments();
userData.setKey(key);
userData.setPdfs(pdfFilesDao);
pm.makePersistent(userData);
OK everything works! BUT I CAN NOT READ PDF DATA NOW!
I have error:
HTTP ERROR 500
Problem accessing /test. Reason:
Could not retrieve entity of kind GoogleDrivePDF with key GoogleDrivePDF("0B1IQEoiXFg3IWHhJNEtlMzlvQWs1")
Caused by:
javax.jdo.JDOObjectNotFoundException: Could not retrieve entity of kind GoogleDrivePDF with key GoogleDrivePDF("0B1IQEoiXFg3IWHhJNEtlMzlvQWs1")
BUT I DO THE SAME , LIKE I WAS DOING:
Key key = KeyFactory.createKey(GoogleDrivePDF.class.getSimpleName(), "0B1IQEoiXFg3IWHhJNEtlMzlvQWs1");
GoogleDrivePDF pdf = pm.getObjectById(GoogleDrivePDF.class, key);
When I was testing, In order to get the value, I need enycrypted String of key. (See image) agtsdHYtY2hlY2tlcnJoCxIRVXNlcnNQREZEb2N1bWVudHMiIXZha2h0YW5nLmtvcm9naGxpc2h2aWxpQGdtYWlsLmNvbQwLEg5Hb29nbGVEcml2ZVBERiIcMEIxSVFFb2lYRmczSVdIaEpORXRsTXpsdlFXcww
when I add Unowned it works! why?!
#Unowned
#Persistent
private List<GoogleDrivePDF> pdfs;

Related Links

Why I got over quota error ? google app engine
If I use ObjectifyFilter I get error
Is there an API for creating google cloud platform credentials?
How to make programmatic access to an appengine application that is secure and authenticated
What App Engine datastore caching strategy will give complete cache consistency?
Google App Engine : High CPU Utilization
appengine cloud storage compile error in demo project
Issue with using the Google Datastore query console
How can I run `gcloud preview app setup-managed-vms` without this error?
Appengine unit test fail with Objectify - No Class registered
What is the name of the database or table?
Google Apps Domain Authentication with Google App Engine - Too many redirects
can I combine NDB and mysqldb in one app on google cloud platform
Logging in a Google Cloud Endpoint
Appengine Maven Plugin - Endpoints Goal - Enable filtering on .discovery files
authentication request once for both side

Categories

HOME
service-worker
notepad++
google-app-engine
httparty
gdb
string
ng-idle
ggplot2
github-for-windows
css3
mysql-workbench
components
x264
data-visualization
odoo-8
mel
gson
distribution
pega
automatic-ref-counting
pybossa
onedrive-api
connector
gmm
replication
ios10.2
visual-studio-extensions
tosca
vex
gitlab-api
mustache
testbed
playstation-portable
rselenium
openwhisk
engine.io
swagger-php
parse-tree
docfx
openproject
zoomify
git-rewrite-history
graphhopper
modernizr
amazon-ses
css-position
urlsession
dbnull
wc
fwrite
httrack
jquery-ui-draggable
java-6
opengl-4
skin
css-transforms
java-websocket
mouseleave
d3-force-directed
renaming
taocp
atlas
winusb
synonym
dimension
cycle2
mobiledoc-kit
rasterize
jnlua
oracle-spatial
poppler
cgi-bin
batik
dulwich
haskell-warp
dronekit-android
airbrake
graphics2d
ansi
teamcity-9.1
phpldapadmin
openbabel
grouping-sets
dbaccess
execve
rickshaw
entry-point
named-parameters
winginx
multitasking
spring-3
isqlquery
cmmi
epiceditor
actiondispatch
traceability
mantle
os.system
listitem
ikimagebrowserview
rmdir
uideviceorientation
dot-emacs
opml
interop-domino
windows-identity
application-planning
online-storage
netbeans6.1

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile