Open expigo opened 5 years ago
For now, EntityMedamodel will be created lazily, on metamodel.getEntityModel() call. It will delegate creation to EntityModel static factory. Consider another solution, where EnitityMetamodel is provided along with the builder; Metamodel holds a field of type EnitityModel.Builder, and when the Metamodel's static factory method is called, methods for getting fileds are called as well, building the EntityModel successively. Then on metamodel.getEntityModel() call, the builder's build() will the invoked and the result of that call will be returned.
The Entity class should be composed of all elements that are a part od DB table metadata, like Primary Key, Column and more to be thinked of later. Later on it will be a starting point in addressing the problem of Object-Relational Impedance Mismatch.