How to persist Custom Java Object in Process engine?

Thanks @thorben. Any suggestions for this?