-1

I have an object in Java that I serialize with all its atributes.

public class Table implements Serializable {
private static final long serialVersionUID = 6529685098267757696L;
String name;
ArrayList<Column> columns;
ArrayList<Constraints> constraints;
ArrayList<Tuples> tuples;
}

I would like to know if it´s possible to load just some attributes of the object (ie: load just the columns atribute). After loading them Change some of their values, and then save them once again without having to load the entire object.

Thanks!

Pablo Estrada
  • 3,182
  • 4
  • 30
  • 74
  • 1
    You could find this thread useful: http://stackoverflow.com/questions/13650457/java-partial-deserialization-of-objects?answertab=active#tab-top – S. Pauk Mar 18 '15 at 19:05

1 Answers1

1

I'm not sure if i have understood properly but i think you just want to send partial data in the serialization process. If i'm rigth you should write your own serialization. You just need to implement writeobject() and readobject() methods doing what you just need to do. In this case, just write and read columns array. It could seem complicated but it's not. Besides, your code will be probably more efficient since default serialization sends the whole object hierarchy.

drusilabs
  • 133
  • 10