From: John P. C. <jp...@jp...> - 2001-08-18 09:44:43
|
> Another question. Can a entity span say parts of one or more tables? Yes, it can span 0 or more tables. They have many uses. Some are by design and others were just discovered. > Something similar like a view in SQL? Yes. > In the example the complete db entitys are mapped in the definition. And so > querys are genearated for all fields. But that might me overhead. So I would > like to define a entity that spans parts of tables. Your queries should be generated only for those fields in your 'object' section of the entity and in the dbschema.inc file. > E.g. If I have a enty defined called "Subscriptions" that span the > tables.fields: > > user.userId > user.login > smssubscriptions.userId > smssubscritpions.serviceId > emailsubscriptions.userId > emailsubscriptions.serviceId > > but the tbl user has more fields I do not need to query for this entity. But > for this one it's just fine. This is fine. I use the entities for single tables, combinations of tables (e.g. contact with associated mailaddress), and multiple records of the same table. The latter can be done, for example, in the case of preferences. Each "field" in the entity may map to an entire record in a preference table. The possibilities aren't endless, but sometimes it seems that way. :-) jpc |