expigo / Winter

ORM and DI framework. Its sole purpose is to learn some of the Java reflection goodies ✌😃
0 stars 0 forks source link

Add Entity class that will work as an DB abstraction for a class to be persisted #3

Open expigo opened 5 years ago

expigo commented 5 years ago

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.

expigo commented 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.