private static void bindFilterDefs(XAnnotatedElement annotatedElement, Mappings mappings) { FilterDef defAnn = annotatedElement.getAnnotation( FilterDef.class ); FilterDefs defsAnn = annotatedElement.getAnnotation( FilterDefs.class ); if ( defAnn != null ) { bindFilterDef( defAnn, mappings ); } if ( defsAnn != null ) { for ( FilterDef def : defsAnn.value() ) { bindFilterDef( def, mappings ); } } }
private static void bindFilterDef(FilterDef defAnn, Mappings mappings) { Map<String, org.hibernate.type.Type> params = new HashMap<String, org.hibernate.type.Type>(); for ( ParamDef param : defAnn.parameters() ) { params.put( param.name(), mappings.getTypeResolver().heuristicType( param.type() ) ); } FilterDefinition def = new FilterDefinition( defAnn.name(), defAnn.defaultCondition(), params ); LOG.debugf( "Binding filter definition: %s", def.getFilterName() ); mappings.addFilterDefinition( def ); }