Exemplo n.º 1
0
 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);
   }
 }
Exemplo n.º 2
0
 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);
   }
 }