Java generation: models are serializable