You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2015/01/27 20:25:30 UTC
[32/37] olingo-odata2 git commit: [OLINGO-537] - Fix for ignoring
EntityListeners getting added to JPAEdmMapping if it does not inherit from
ODataJPATombstoneEntityListener
[OLINGO-537] - Fix for ignoring EntityListeners getting added to
JPAEdmMapping if it does not inherit from
ODataJPATombstoneEntityListener
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/9d63ef43
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/9d63ef43
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/9d63ef43
Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 9d63ef43219eeafc9ab2f2de8270333952258aa5
Parents: 5c6af74
Author: Chandan V A <ch...@sap.com>
Authored: Fri Jan 16 09:46:32 2015 +0530
Committer: Chandan V A <ch...@sap.com>
Committed: Fri Jan 16 09:46:32 2015 +0530
----------------------------------------------------------------------
.../jpa/processor/core/model/JPAEdmEntityType.java | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/9d63ef43/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityType.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityType.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityType.java
index eea7254..24878dc 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityType.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityType.java
@@ -113,15 +113,13 @@ public class JPAEdmEntityType extends JPAEdmBaseViewImpl implements JPAEdmEntity
JPAEdmMapping jpaEdmMapping = (JPAEdmMapping) currentEdmEntityType.getMapping();
EntityListeners entityListners = currentJPAEntityType.getJavaType().getAnnotation(EntityListeners.class);
if (entityListners != null) {
- for (Class<? extends ODataJPATombstoneEntityListener> entityListner : entityListners.value())
+ for (Class<EntityListeners> entityListner : entityListners.value())
{
- try {
- jpaEdmMapping.setODataJPATombstoneEntityListener(entityListner);
- break;
- } catch (ClassCastException e) {
- continue;
- }
-
+ if (ODataJPATombstoneEntityListener.class.isAssignableFrom(entityListner)) {
+ jpaEdmMapping
+ .setODataJPATombstoneEntityListener((Class<? extends ODataJPATombstoneEntityListener>) entityListner);
+ break;
+ }
}
}
JPAEdmPropertyView propertyView = new JPAEdmProperty(schemaView);