HHH-6173 Fixing some bugs and adding some improvements pointed out by Strong

This commit is contained in:
Hardy Ferentschik 2011-06-24 10:54:53 +02:00
parent 08ed4c1e80
commit 157d50b434
3 changed files with 8 additions and 16 deletions

View File

@ -38,6 +38,7 @@ public enum AttributeType {
ONE_TO_MANY( JPADotNames.ONE_TO_MANY ),
MANY_TO_ONE( JPADotNames.MANY_TO_ONE ),
MANY_TO_MANY( JPADotNames.MANY_TO_MANY ),
ELEMENT_COLLECTION( JPADotNames.ELEMENT_COLLECTION ),
EMBEDDED( JPADotNames.EMBEDDED );
private final DotName annotationDotName;

View File

@ -175,27 +175,18 @@ public class ConfiguredClass {
}
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;
}
}
private AccessType determineClassAccessType(AccessType defaultAccessType) {

View File

@ -151,7 +151,7 @@ public class EntityClass extends ConfiguredClass {
}
private IdType determineIdType() {
List<AnnotationInstance> idAnnotations = getClassInfo().annotations().get( JPADotNames.ENTITY );
List<AnnotationInstance> idAnnotations = getClassInfo().annotations().get( JPADotNames.ID );
List<AnnotationInstance> embeddedIdAnnotations = getClassInfo()
.annotations()
.get( JPADotNames.EMBEDDED_ID );