Java 类javax.persistence.NamedStoredProcedureQueries 实例源码

项目:lams    文件:JPAOverriddenAnnotationReader.java   
private NamedStoredProcedureQueries getNamedStoredProcedureQueries(Element tree, XMLContext.Default defaults) {
    List<NamedStoredProcedureQuery> queries = buildNamedStoreProcedureQueries( tree, defaults );
    if ( defaults.canUseJavaAnnotations() ) {
        NamedStoredProcedureQuery annotation = getPhysicalAnnotation( NamedStoredProcedureQuery.class );
        addNamedStoredProcedureQueryIfNeeded( annotation, queries );
        NamedStoredProcedureQueries annotations = getPhysicalAnnotation( NamedStoredProcedureQueries.class );
        if ( annotations != null ) {
            for ( NamedStoredProcedureQuery current : annotations.value() ) {
                addNamedStoredProcedureQueryIfNeeded( current, queries );
            }
        }
    }
    if ( queries.size() > 0 ) {
        AnnotationDescriptor ad = new AnnotationDescriptor( NamedStoredProcedureQueries.class );
        ad.setValue( "value", queries.toArray( new NamedStoredProcedureQuery[queries.size()] ) );
        return AnnotationFactory.create( ad );
    }
    else {
        return null;
    }
}
项目:lams    文件:AnnotationBinder.java   
private static void bindNamedStoredProcedureQueries(Mappings mappings, NamedStoredProcedureQueries annotation, boolean isDefault) {
    if ( annotation != null ) {
        for ( NamedStoredProcedureQuery queryAnnotation : annotation.value() ) {
            bindNamedStoredProcedureQuery( mappings, queryAnnotation, isDefault );
        }
    }
}