The goal is to meet these requirements during coding:
- Entity classes may include validation
- Data members have accessor (getters and setters)
- Entity classes may have other methods
- Entity class type is important (this encapsulates the previous three points)
- Missing data in the JSON source should be logged.
- Extra data in the JSON source should be logged.
- Support DRY - Don't Repeat Yourself
Full disclosure here: I know that there are two big problems with what I am about to describe. If you have been trying to handle ORM conversion already, you may have hit them. The problems are not insurmountable, but we'll get to that later.