Skip to content

Instantly share code, notes, and snippets.

@stliu
Created June 24, 2011 07:59
Show Gist options
  • Save stliu/1044408 to your computer and use it in GitHub Desktop.
Save stliu/1044408 to your computer and use it in GitHub Desktop.
ConfiguredClassType#determinType
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