Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Thing updateA( final String uid, final int value ) {
- return ofy().transact(new Work<Thing>() {
- @Override
- public Thing run() {
- Thing thing = ofy().load().type(Thing.class).id(uid).safe();
- if (thing.a != value) {
- thing.a = value;
- ofy().save().entity(thing);
- } else {
- // there is no save() required here and I get away with 1 operation cheaper, yet all is serial and safe?
- }
- return thing;
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement