thank you for the extensive information.
daelmo wrote:
I can think in a few differences (could be interpreted as advantages or disaventages depending the scenario):
well ... I understand the basic differences between tables and views. I'm conceptually still a bit confused about the fact that in LGP you can treat views as tables (entities) ...
daelmo wrote:
Entities usually have a primary key.
but now I can also add a primary key to a view. Which is quite an interesting aspect ...
daelmo wrote:
Views are read-only. You ussually want this.
well yes ... but if I now create an entity based on a view ... how does LGP behave if I want to insert something into this entity?
daelmo wrote:
Views are a direct way to obtain specific data. For example, in reporting scenarios, some people use them to obtain info directly from DB and bound them to report viewers.
that's what I was thinking about. Since I'm rather a db designer/analyst than programmer (unfortunately I have to do programming too), I would rather have the data retrieval logic in the db (view) than fetch/join it through LGP.
daelmo wrote:
For example, if you have the entity "Customer" and you have the entity mapped on view "CustomerWhoBuyCandies" that is based on customer data, you could make the CustomerId of the "CustomerWhoBuyCandies" "part of the primary key", then you could make a 1:1 relation with the Customer entity.
that's what I was referring to ... basically the entities in LGP can do everything that views can do (since they can be based on views) and many things more. So I'm wondering which advantage the views still have (in LGP) ...
If I base an entity on a view instead of using the view "directly", I can set primary key information, set relations (with this also use prefetch paths) etc.