org.hibernate.annotations.FilterDef Java Examples
The following examples show how to use
org.hibernate.annotations.FilterDef.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AnnotationBinder.java From lams with GNU General Public License v2.0 | 5 votes |
private static void bindFilterDefs(XAnnotatedElement annotatedElement, MetadataBuildingContext context) { FilterDef defAnn = annotatedElement.getAnnotation( FilterDef.class ); FilterDefs defsAnn = annotatedElement.getAnnotation( FilterDefs.class ); if ( defAnn != null ) { bindFilterDef( defAnn, context ); } if ( defsAnn != null ) { for ( FilterDef def : defsAnn.value() ) { bindFilterDef( def, context ); } } }
Example #2
Source File: AnnotationBinder.java From lams with GNU General Public License v2.0 | 4 votes |
private static void bindFilterDef(FilterDef defAnn, MetadataBuildingContext context) { Map<String, org.hibernate.type.Type> params = new HashMap<>(); for ( ParamDef param : defAnn.parameters() ) { params.put( param.name(), context.getMetadataCollector().getTypeResolver().heuristicType( param.type() ) ); } FilterDefinition def = new FilterDefinition( defAnn.name(), defAnn.defaultCondition(), params ); LOG.debugf( "Binding filter definition: %s", def.getFilterName() ); context.getMetadataCollector().addFilterDefinition( def ); }