コード例 #1
0
 private FilterSource[] determineFilterSources(PluralAssociationAttribute associationAttribute) {
   AnnotationInstance filtersAnnotation =
       JandexHelper.getSingleAnnotation(
           associationAttribute.annotations(), HibernateDotNames.FILTERS);
   List<FilterSource> filterSourceList = new ArrayList<FilterSource>();
   if (filtersAnnotation != null) {
     AnnotationInstance[] annotationInstances = filtersAnnotation.value().asNestedArray();
     for (AnnotationInstance filterAnnotation : annotationInstances) {
       FilterSource filterSource =
           new FilterSourceImpl(filterAnnotation, entityClass.getLocalBindingContext());
       filterSourceList.add(filterSource);
     }
   }
   AnnotationInstance filterAnnotation =
       JandexHelper.getSingleAnnotation(
           associationAttribute.annotations(), HibernateDotNames.FILTER);
   if (filterAnnotation != null) {
     FilterSource filterSource =
         new FilterSourceImpl(filterAnnotation, entityClass.getLocalBindingContext());
     filterSourceList.add(filterSource);
   }
   if (filterSourceList.isEmpty()) {
     return null;
   } else {
     return filterSourceList.toArray(new FilterSource[filterSourceList.size()]);
   }
 }
コード例 #2
0
 private static List<RelationalValueSource> createRelationalValueSources(
     PluralAssociationAttribute attribute) {
   AnnotationInstance columnAnnotation =
       JandexHelper.getSingleAnnotation(attribute.annotations(), HibernateDotNames.INDEX_COLUMN);
   if (columnAnnotation == null) {
     columnAnnotation =
         JandexHelper.getSingleAnnotation(attribute.annotations(), JPADotNames.ORDER_COLUMN);
   }
   if (columnAnnotation == null) {
     columnAnnotation =
         JandexHelper.getSingleAnnotation(attribute.annotations(), JPADotNames.MAP_KEY_COLUMN);
   }
   Column indexColumn = new Column(columnAnnotation);
   return Collections.singletonList((RelationalValueSource) new ColumnSourceImpl(indexColumn));
 }