You can achieve the same 'fetch or create' entity functionality in Java using a simple 'try/catch' block <https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/appengine/datastore/src/test/java/com/example/appengine/TransactionsTest.java#L228>. This is essentially the same way the Python 'get_or_insert()' method works, and you can therefore simply add this in your code manually. You can find our Java documentation <https://cloud.google.com/appengine/docs/java/datastore/transactions#uses_for_transactions> explaining this specific use of transactions, as seen in the second provided example.
-- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/db71b0bf-261f-403d-a625-01b7a42c2f9f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
