* The example formatting is off, two lines appended to one. The example should be relevant to something that a user would want to do, i.e. ."this.isDeleted = false", or effective dates, or tenants.

+

* The example formatting is off, two lines appended to one. The example should be relevant to something that a user would want to do, i.e. ."this.isDeleted = false", or effective dates, or tenants. ''[fixed - bg]''

−

* Should state the purpose of this feature, why would someone want to use it? Soft deletes, history, multi-tenancy, shared table

+

* Should state the purpose of this feature, why would someone want to use it? Soft deletes, history, multi-tenancy, shared table ''[added -bg. But I need more information about how/why this feature is useful for those items]''

Why is this useful for multi-tenancy, soft deletes, history, shared tables, and temporal filtering? Can someone provide examples, if you think that would be helpful?

+

+

:The reason for AdditionalCriteria is to support parametrized views on the user's data.

+

+

:Multi-tenancy is when you have the data for several applications/users/tenants in the same table. Each tenant only wants to see their own data.

+

:To do this with AdditionalCriteria, you would define @AdditionalCriteria("TENANT = 'Billing'") if you were building an application just for billing that used shared data. Or, @AdditionalCriteria("this.tenant = :tenant") if you application could be used by multiple different tenants (at the same time). When the tenant acquired its EntityManagerFactory or EntityManager it would set the persistence/entity manager property "tenant" to their name.

Latest revision as of 13:07, 21 April 2011

Comments

Documentation should be from JPA perspective, not native API, do not talk about descriptors, expressions etc., talk about Entities, Queries. [fixed - bg]

Merging and overriding applies to all annotations/xml, should not document it in here or in every page, but have a single page that documents the overriding behavior. [fixed - bg]

Examples are not use "source lang="java"/"xml"" tags. [fixed - bg]

The example formatting is off, two lines appended to one. The example should be relevant to something that a user would want to do, i.e. ."this.isDeleted = false", or effective dates, or tenants. [fixed - bg]

Should state the purpose of this feature, why would someone want to use it? Soft deletes, history, multi-tenancy, shared table [added -bg. But I need more information about how/why this feature is useful for those items]

Questions 4/4/11 BG
Why is this useful for multi-tenancy, soft deletes, history, shared tables, and temporal filtering? Can someone provide examples, if you think that would be helpful?

The reason for AdditionalCriteria is to support parametrized views on the user's data.

Multi-tenancy is when you have the data for several applications/users/tenants in the same table. Each tenant only wants to see their own data.

To do this with AdditionalCriteria, you would define @AdditionalCriteria("TENANT = 'Billing'") if you were building an application just for billing that used shared data. Or, @AdditionalCriteria("this.tenant = :tenant") if you application could be used by multiple different tenants (at the same time). When the tenant acquired its EntityManagerFactory or EntityManager it would set the persistence/entity manager property "tenant" to their name.