Beispiel #1
0
 @Override
 public com.xhills.golf_party.model.course.Area entityToModel(
     com.google.appengine.api.datastore.Entity entity) {
   com.xhills.golf_party.model.course.Area model = new com.xhills.golf_party.model.course.Area();
   model.setKey(entity.getKey());
   model.setName((java.lang.String) entity.getProperty("name"));
   model.setVersion((java.lang.Long) entity.getProperty("version"));
   return model;
 }
Beispiel #2
0
 @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;
 }
Beispiel #3
0
 @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;
 }
Beispiel #4
0
 @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();
 }
Beispiel #5
0
 @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));
 }
Beispiel #6
0
 @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;
 }
Beispiel #7
0
 @Override
 protected void setKey(Object model, com.google.appengine.api.datastore.Key key) {
   validateKey(key);
   com.xhills.golf_party.model.course.Area m = (com.xhills.golf_party.model.course.Area) model;
   m.setKey(key);
 }
Beispiel #8
0
 @Override
 protected com.google.appengine.api.datastore.Key getKey(Object model) {
   com.xhills.golf_party.model.course.Area m = (com.xhills.golf_party.model.course.Area) model;
   return m.getKey();
 }