@Override protected com.xhills.golf_party.model.course.Area jsonToModel( org.slim3.datastore.json.JsonRootReader rootReader, int maxDepth, int currentDepth) { com.xhills.golf_party.model.course.Area m = new com.xhills.golf_party.model.course.Area(); org.slim3.datastore.json.JsonReader reader = null; org.slim3.datastore.json.Default decoder0 = new org.slim3.datastore.json.Default(); reader = rootReader.newObjectReader("key"); m.setKey(decoder0.decode(reader, m.getKey())); reader = rootReader.newObjectReader("name"); m.setName(decoder0.decode(reader, m.getName())); reader = rootReader.newObjectReader("version"); m.setVersion(decoder0.decode(reader, m.getVersion())); return m; }
@Override public com.google.appengine.api.datastore.Entity modelToEntity(java.lang.Object model) { com.xhills.golf_party.model.course.Area m = (com.xhills.golf_party.model.course.Area) model; com.google.appengine.api.datastore.Entity entity = null; if (m.getKey() != null) { entity = new com.google.appengine.api.datastore.Entity(m.getKey()); } else { entity = new com.google.appengine.api.datastore.Entity(kind); } entity.setProperty("name", m.getName()); entity.setProperty("version", m.getVersion()); entity.setProperty("slim3.schemaVersion", 1); return entity; }
@Override protected void modelToJson( org.slim3.datastore.json.JsonWriter writer, java.lang.Object model, int maxDepth, int currentDepth) { com.xhills.golf_party.model.course.Area m = (com.xhills.golf_party.model.course.Area) model; writer.beginObject(); org.slim3.datastore.json.Default encoder0 = new org.slim3.datastore.json.Default(); if (m.getKey() != null) { writer.setNextPropertyName("key"); encoder0.encode(writer, m.getKey()); } if (m.getName() != null) { writer.setNextPropertyName("name"); encoder0.encode(writer, m.getName()); } if (m.getVersion() != null) { writer.setNextPropertyName("version"); encoder0.encode(writer, m.getVersion()); } writer.endObject(); }
@Override protected void incrementVersion(Object model) { com.xhills.golf_party.model.course.Area m = (com.xhills.golf_party.model.course.Area) model; long version = m.getVersion() != null ? m.getVersion().longValue() : 0L; m.setVersion(Long.valueOf(version + 1L)); }
@Override protected long getVersion(Object model) { com.xhills.golf_party.model.course.Area m = (com.xhills.golf_party.model.course.Area) model; return m.getVersion() != null ? m.getVersion().longValue() : 0L; }