super("Hoge", Hoge.class);
}
@Override
public Hoge entityToModel(Entity entity) {
Hoge model = new Hoge();
model.setKey(entity.getKey());
model.setMyPrimitiveShort(longToPrimitiveShort((Long) entity
.getProperty("myPrimitiveShort")));
model.setMyShort(longToShort((Long) entity.getProperty("myShort")));
model.setMyPrimitiveInt(longToPrimitiveInt((Long) entity
.getProperty("myPrimitiveInt")));
model
.setMyInteger(longToInteger((Long) entity.getProperty("myInteger")));
model.setMyPrimitiveLong(longToPrimitiveLong((Long) entity
.getProperty("myPrimitiveLong")));
model.setMyLong((Long) entity.getProperty("myLong"));
model.setMyPrimitiveFloat(doubleToPrimitiveFloat((Double) entity
.getProperty("myPrimitiveFloat")));
model.setMyFloat(doubleToFloat((Double) entity.getProperty("myFloat")));
model.setMyPrimitiveDouble(doubleToPrimitiveDouble((Double) entity
.getProperty("myPrimitiveDouble")));
model.setMyDouble((Double) entity.getProperty("myDouble"));
model.setMyString((String) entity.getProperty("myString"));
model.setMyPrimitiveBoolean(booleanToPrimitiveBoolean((Boolean) entity
.getProperty("myPrimitiveBoolean")));
model.setMyBoolean((Boolean) entity.getProperty("myBoolean"));
model.setMyDate((Date) entity.getProperty("myDate"));
model.setMyEnum(stringToEnum(SortDirection.class, (String) entity
.getProperty("myEnum")));
model.setMyStringText(textToString((Text) entity
.getProperty("myStringText")));
model.setMyText((Text) entity.getProperty("myText"));
model.setMyBytes(shortBlobToBytes((ShortBlob) entity
.getProperty("myBytes")));
model.setMyBytesBlob(blobToBytes((Blob) entity
.getProperty("myBytesBlob")));
model
.setMySerializable((MySerializable) shortBlobToSerializable((ShortBlob) entity
.getProperty("mySerializable")));
model
.setMySerializableBlob((MySerializable) blobToSerializable((Blob) entity
.getProperty("mySerializableBlob")));
model.setMyBlob((Blob) entity.getProperty("myBlob"));
model.setMyShortBlob((ShortBlob) entity.getProperty("myShortBlob"));
model.setMyShortList(longListToShortList(entity
.getProperty("myShortList")));
model.setMyShortSet(new HashSet<Short>(longListToShortList(entity
.getProperty("myShortSet"))));
model.setMyShortSortedSet(new TreeSet<Short>(longListToShortList(entity
.getProperty("myShortSortedSet"))));
model.setMyIntegerList(longListToIntegerList(entity
.getProperty("myIntegerList")));
model.setMyIntegerSet(new HashSet<Integer>(longListToIntegerList(entity
.getProperty("myIntegerSet"))));
model.setMyIntegerSortedSet(new TreeSet<Integer>(
longListToIntegerList(entity.getProperty("myIntegerSortedSet"))));
model
.setMyLongList(toList(Long.class, entity.getProperty("myLongList")));
model.setMyLongSet(new HashSet<Long>(toList(Long.class, entity
.getProperty("myLongSet"))));
model.setMyLongSortedSet(new TreeSet<Long>(toList(Long.class, entity
.getProperty("myLongSortedSet"))));
model.setMyFloatList(doubleListToFloatList(entity
.getProperty("myFloatList")));
model.setMyFloatSet(new HashSet<Float>(doubleListToFloatList(entity
.getProperty("myFloatSet"))));
model.setMyFloatSortedSet(new TreeSet<Float>(
doubleListToFloatList(entity.getProperty("myFloatSortedSet"))));
model.setMyEnumList(stringListToEnumList(SortDirection.class, entity
.getProperty("myEnumList")));
model.setMyStringList(toList(String.class, entity
.getProperty("myStringList")));
model.setVersion((Long) entity.getProperty("version"));
model.setMyCipherLobString(decrypt(textToString((Text) entity
.getProperty("myCipherLobString"))));
model.setMyCipherString(decrypt((java.lang.String) entity
.getProperty("myCipherString")));
model
.setMyCipherText(decrypt((Text) entity.getProperty("myCipherText")));
return model;
}