If i implementing Serializable
on every class of my application so that application can be easily run on Jboss cluster environment.
Now if i implemented Serializable
in my classes ,eclipse showing below message
The serializable class does not declare a static final serialVersionUID field of type long
Now it is giving me three options
- Add Default Serial version ID
- Add generated Serial version ID
- Add @SuppressWarings to 'serial'
If i will choose first it will generate like this
private static final long serialVersionUID = 1L;
If i will choose second it will generate like this
private static final long serialVersionUID = 1629728947486980072L;
Third we can easily ignore because we have to run the application in cluster environment so we have to add versionID anyhow What is a serialVersionUID and why should I use it?
Now as i told i have to implement serialization each and very class which one is better approach. Approach1 or Appraoch2?
- Add Default Serial version ID
- Add generated Serial version ID