use of com.blazebit.persistence.view.Self in project blaze-persistence by Blazebit.
the class AnnotationMappingReader method getMapping.
public static Annotation getMapping(AnnotatedElement annotatedElement, Constructor<?> constructor, int index, MetamodelBootContext context) {
if (annotatedElement.isAnnotationPresent(IdMapping.class)) {
context.addError("The @IdMapping annotation is disallowed for entity view constructors for the " + ParameterAttributeMapping.getLocation(constructor, index));
return null;
}
Mapping mapping = annotatedElement.getAnnotation(Mapping.class);
if (mapping != null) {
return mapping;
}
MappingParameter mappingParameter = annotatedElement.getAnnotation(MappingParameter.class);
if (mappingParameter != null) {
return mappingParameter;
}
MappingSubquery mappingSubquery = annotatedElement.getAnnotation(MappingSubquery.class);
if (mappingSubquery != null) {
return mappingSubquery;
}
MappingCorrelated mappingCorrelated = annotatedElement.getAnnotation(MappingCorrelated.class);
if (mappingCorrelated != null) {
return mappingCorrelated;
}
MappingCorrelatedSimple mappingCorrelatedSimple = annotatedElement.getAnnotation(MappingCorrelatedSimple.class);
if (mappingCorrelatedSimple != null) {
return mappingCorrelatedSimple;
}
Self self = annotatedElement.getAnnotation(Self.class);
if (self != null) {
return self;
}
context.addError("No entity view mapping annotation given for the " + ParameterAttributeMapping.getLocation(constructor, index));
return null;
}
Aggregations