Modifying code generator for persistence