You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by "Birenheide, Richard" <ri...@sap.com> on 2015/12/15 10:29:10 UTC

NOT exposing a single JPA entity in the JPA model

Hi,

in V2 JPA mapping, is it possible to have an entity in the JPA model and not to expose it in the service?

Use case: I have user header data, which I wish to expose and user details which should be exposed only to the individual user (like notification settings) by mean s of function imports. Therefore it would be useful to have both entities in the same model, but only expose insensitive data as entity set.

Regards
Richard

Dr. Richard Birenheide
Development Architect
Suite Architecture
SAP SE
Dietmar-Hopp-Allee 16,
69190 Walldorf
Germany
T +49 / 6227 / 7-42303
F +49 / 6227 / 7835816
E richard.birenheide@sap.com
http://www.sap.com<http://www.sap.com/>
Pflichtangaben/Mandatory Disclosure Statements: http://www.sap.com/company/legal/impressum.epx
Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt. Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank.
This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.


RE: NOT exposing a single JPA entity in the JPA model

Posted by "V.A, Chandan" <ch...@sap.com>.
Hello Richard,
This is possible via mapping XML. You need to add the attribute exclude = true to the JPAEntityType XML elememt.

Example
<JPAEDMMappingModel
       xmlns="http://www.apache.org/olingo/odata2/jpa/processor/api/model/mapping">
       <PersistenceUnit name="salesorderprocessing">
              <EDMSchemaNamespace>SalesOrderProcessing</EDMSchemaNamespace>
              <JPAEntityTypes>
                     <JPAEntityType name="Customer" exclude=”true”>
….
…


Thanks
Kind Regards
Chandan

From: Birenheide, Richard [mailto:richard.birenheide@sap.com]
Sent: Tuesday, December 15, 2015 2:59 PM
To: user@olingo.apache.org
Subject: NOT exposing a single JPA entity in the JPA model

Hi,

in V2 JPA mapping, is it possible to have an entity in the JPA model and not to expose it in the service?

Use case: I have user header data, which I wish to expose and user details which should be exposed only to the individual user (like notification settings) by mean s of function imports. Therefore it would be useful to have both entities in the same model, but only expose insensitive data as entity set.

Regards
Richard

Dr. Richard Birenheide
Development Architect
Suite Architecture
SAP SE
Dietmar-Hopp-Allee 16,
69190 Walldorf
Germany
T +49 / 6227 / 7-42303
F +49 / 6227 / 7835816
E richard.birenheide@sap.com<ma...@sap.com>
http://www.sap.com<http://www.sap.com/>
Pflichtangaben/Mandatory Disclosure Statements: http://www.sap.com/company/legal/impressum.epx
Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Kenntnisnahme des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt. Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank.
This e-mail may contain trade secrets or privileged, undisclosed, or otherwise confidential information. If you have received this e-mail in error, you are hereby notified that any review, copying, or distribution of it is strictly prohibited. Please inform us immediately and destroy the original transmittal. Thank you for your cooperation.