-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from mmnaseri/release-v1.1.1#74
Release v1.1.1#74
- Loading branch information
Showing
4 changed files
with
68 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,10 +15,13 @@ | |
import java.util.List; | ||
|
||
/** | ||
* Utilities for figuring out the specifics of the ID property | ||
* | ||
* @author Mohammad Milad Naseri ([email protected]) | ||
* @since 1.0 (6/8/16, 1:43 AM) | ||
*/ | ||
final class IdPropertyResolverUtils { | ||
@SuppressWarnings("WeakerAccess") | ||
public final class IdPropertyResolverUtils { | ||
|
||
private static final List<String> ID_ANNOTATIONS = new ArrayList<>(); | ||
private static final Log log = LogFactory.getLog(IdPropertyResolverUtils.class); | ||
|
@@ -39,7 +42,7 @@ private IdPropertyResolverUtils() { | |
* @param idAnnotatedMethod the method that will return the ID (e.g. getter for the ID property) | ||
* @return the name of the property, or {@literal null} if the method is {@literal null} | ||
*/ | ||
static String getPropertyNameFromAnnotatedMethod(Class<?> entityType, Class<? extends Serializable> idType, Method idAnnotatedMethod) { | ||
public static String getPropertyNameFromAnnotatedMethod(Class<?> entityType, Class<? extends Serializable> idType, Method idAnnotatedMethod) { | ||
if (idAnnotatedMethod != null) { | ||
final String name = PropertyUtils.getPropertyName(idAnnotatedMethod); | ||
if (!idType.isAssignableFrom(idAnnotatedMethod.getReturnType())) { | ||
|
@@ -57,7 +60,7 @@ static String getPropertyNameFromAnnotatedMethod(Class<?> entityType, Class<? ex | |
* @param element the element to be examined | ||
* @return {@literal true} if the element has any of the ID annotations | ||
*/ | ||
static boolean isAnnotated(AnnotatedElement element) { | ||
public static boolean isAnnotated(AnnotatedElement element) { | ||
final List<Class<? extends Annotation>> annotations = getIdAnnotations(); | ||
for (Class<? extends Annotation> annotation : annotations) { | ||
if (AnnotationUtils.findAnnotation(element, annotation) != null) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters