implement serializable to entity classes