Created
June 24, 2011 07:59
-
-
Save stliu/1044408 to your computer and use it in GitHub Desktop.
ConfiguredClassType#determinType
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
private ConfiguredClassType determineType() { | |
- AnnotationInstance entityAnnotation = JandexHelper.getSingleAnnotation( | |
- classInfo, JPADotNames.ENTITY | |
- ); | |
- if ( entityAnnotation != null ) { | |
+ if ( classInfo.annotations().containsKey( JPADotNames.ENTITY ) ) { | |
return ConfiguredClassType.ENTITY; | |
} | |
- | |
- AnnotationInstance mappedSuperClassAnnotation = JandexHelper.getSingleAnnotation( | |
- classInfo, JPADotNames.MAPPED_SUPERCLASS | |
- ); | |
- if ( mappedSuperClassAnnotation != null ) { | |
+ else if ( classInfo.annotations().containsKey( JPADotNames.MAPPED_SUPERCLASS ) ) { | |
return ConfiguredClassType.MAPPED_SUPERCLASS; | |
} | |
- | |
- AnnotationInstance embeddableAnnotation = JandexHelper.getSingleAnnotation( | |
- classInfo, JPADotNames.EMBEDDABLE | |
- ); | |
- if ( embeddableAnnotation != null ) { | |
+ else if ( classInfo.annotations().containsKey( JPADotNames.EMBEDDABLE ) ) { | |
return ConfiguredClassType.EMBEDDABLE; | |
} | |
- return ConfiguredClassType.NON_ENTITY; | |
+ else { | |
+ return ConfiguredClassType.NON_ENTITY; | |
+ } | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment