From a7e57844065d91fd96cd999f2e6ff7c2ad2c1a3d Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Wed, 16 Jan 2013 17:46:46 +0100 Subject: [PATCH] DATAJPA-283 - Support accessor method level mapping annotations. Upgraded to use new methods introduced for DATACMNS-269 to be able to detect mapping annotations independently of whether they are declared on the field or an accessor method for the property. Upgraded to new artifactId Spring Data Commons is distributed under. --- pom.xml | 2 +- .../data/jpa/mapping/JpaPersistentPropertyImpl.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index ed333597b..fe7cd1a31 100644 --- a/pom.xml +++ b/pom.xml @@ -241,7 +241,7 @@ ${project.groupId} - spring-data-commons-core + spring-data-commons ${spring.data.commons.version} diff --git a/src/main/java/org/springframework/data/jpa/mapping/JpaPersistentPropertyImpl.java b/src/main/java/org/springframework/data/jpa/mapping/JpaPersistentPropertyImpl.java index 15ce436fd..345dd8a54 100644 --- a/src/main/java/org/springframework/data/jpa/mapping/JpaPersistentPropertyImpl.java +++ b/src/main/java/org/springframework/data/jpa/mapping/JpaPersistentPropertyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 the original author or authors. + * Copyright 2012-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,7 +91,7 @@ class JpaPersistentPropertyImpl extends AnnotationBasedPersistentProperty annotation : ID_ANNOTATIONS) { - if (field.getAnnotation(annotation) != null) { + if (isAnnotationPresent(annotation)) { return true; } } @@ -122,7 +122,7 @@ class JpaPersistentPropertyImpl extends AnnotationBasedPersistentProperty annotationType : ASSOCIATION_ANNOTATIONS) { - if (field.getAnnotation(annotationType) != null) { + if (findAnnotation(annotationType) != null) { return true; } }