コード例 #1
0
ファイル: SerializedEntity.java プロジェクト: cinar/requery
 private void writeObject(ObjectOutputStream stream) throws IOException {
   stream.defaultWriteObject();
   Type<E> type = SerializationContext.getType(entityClass);
   EntityProxy<E> proxy = type.proxyProvider().apply(entity);
   for (Property<E, ?> property : proxy.filterProperties(getPropertyFilter())) {
     Object value = property.get();
     stream.writeObject(value);
   }
 }
コード例 #2
0
ファイル: SerializedEntity.java プロジェクト: cinar/requery
 private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
   stream.defaultReadObject();
   Type<E> type = SerializationContext.getType(entityClass);
   entity = type.factory().get();
   EntityProxy<E> proxy = type.proxyProvider().apply(entity);
   for (Property<E, ?> property : proxy.filterProperties(getPropertyFilter())) {
     Object value = stream.readObject();
     property.setObject(value, PropertyState.LOADED);
   }
 }