google-app-engine


Save result from Objectify in human readable form in datastore


I am trying to create an Eventlog (ORMSLOG in example), that saves events in human readable form in Datastore.
Doing this should write readable event:
List<Device> devices = ofy().transactionless().load().type(Device.class).list();
ORMSLOG.log(ORMSLOG.GET_ALL_DEVICES, "Devices found: " + String.valueOf(devices));
The ORMSLOG is a simple class.
public class ORMSLOG {
public final static String CREATE_DEVICE = "Create Device";
public final static String GET_ALL_DEVICES = "Get all Devices";
public static void log(final String event, final String data) {
ofy().save().entity(new Event(event, data)).now();
}
}
But the data saved in Datastore is not readable and looks like this:
ORMSLOG data
I need to transform the reference to the object into human readable text.
You are just logging the String representation of the objects, which is done by calling the toString method. Since you did not override the toString method in the Device class, you are getting the pointer to the objects. If you override the toString method in your Device class to return whatever state you want to return, you would see a much better result. Most IDEs (e.g. Eclipse) have an option to generate toString method for you.

Related Links

Appengine application as OpenId provider. Is it possible?
How to set CSS style colors in GWT
How do I suppress App Engine logging while running unit tests?
Google App Engine: Java version of the python deferred library?
Appengine Datastore Advantages [closed]
Are crons executed globally or per app instance (i.e. load dependent)?
AppEngine as WebService and S3 as storage
Setting cookie in LiftFilter
Send Emails From AppEngine Locally
ImportError: cannot import name taskqueue
gwt appengine - user service return page
Uploading a file to AppEngine using GWT: How to provide feedback to the user?
Blackberry Push SDK on Google App Engine
App engine 1.4.0 urlfetch() data over 1M
Google App Engine + Validation
GQL Random Record [duplicate]

Categories

HOME
fabricjs
prism
deep-learning
ng-idle
datastore
jmx
toolbox
knitr
newrelic
yandex
ado.net
vsm
tvos
performancepoint
vimdiff
reactive-programming
x-cart
openbugs
automatic-ref-counting
parameter-passing
gruntfile
linear-algebra
powershell-v5.0
google-data-studio
xmonad
sigma.js
ember-cli
angular-routing
visual-studio-extensions
displaytag
siri
syntax-highlighting
licensing
delimiter
openmdao
twiml
ntp
linkedhashmap
keras-layer
openwhisk
carriage-return
imx6
wurfl
watchman
dm-script
cd
android-augmented-reality
urlsession
apriori
branching-and-merging
linqpad
oracle-service-bus
memory-mapping
uiimage
oim
rfc3339
clarifai
netbeans6.8
quicktime
template-toolkit
renaming
branch-prediction
sandcastle
latin
segment-io
lrs
myspace
mongodb-php
x-tag
installshield-2010
qbxml
tfs-workitem
microsoft-reporting
text-search
ansi
cakephp-2.7
structuremap3
deform
paw
hidapi
abstract-data-type
jquery-1.9
diem
pdfviewer
fusefabric
cross-database
pinch
screen-size
mysql-error-1205
lr
cgbitmapcontextcreate
inline-formset
msr
twitterizer
resharper-6.0
cruisecontrol.rb
vs-android
dot-emacs
data-mapping
sun
scrubyt
fault-tolerance

Resources

Encrypt Message