微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

javax.persistence.NamedEntityGraphs的实例源码

项目:lams    文件JPAOverriddenAnnotationReader.java   
private NamedEntityGraphs getNamedEntityGraphs(Element tree,XMLContext.Default defaults) {
    List<NamedEntityGraph> queries = buildNamedEntityGraph( tree,defaults );
    if ( defaults.canUseJavaAnnotations() ) {
        NamedEntityGraph annotation = getPhysicalAnnotation( NamedEntityGraph.class );
        addNamedEntityGraphIfNeeded( annotation,queries );
        NamedEntityGraphs annotations = getPhysicalAnnotation( NamedEntityGraphs.class );
        if ( annotations != null ) {
            for ( NamedEntityGraph current : annotations.value() ) {
                addNamedEntityGraphIfNeeded( current,queries );
            }
        }
    }
    if ( queries.size() > 0 ) {
        AnnotationDescriptor ad = new AnnotationDescriptor( NamedEntityGraphs.class );
        ad.setValue( "value",queries.toArray( new NamedEntityGraph[queries.size()] ) );
        return AnnotationFactory.create( ad );
    }
    else {
        return null;
    }
}
项目:lams    文件EntityBinder.java   
private void processNamedEntityGraphs() {
    processNamedEntityGraph( annotatedClass.getAnnotation( NamedEntityGraph.class ) );
    final NamedEntityGraphs graphs = annotatedClass.getAnnotation( NamedEntityGraphs.class );
    if ( graphs != null ) {
        for ( NamedEntityGraph graph : graphs.value() ) {
            processNamedEntityGraph( graph );
        }
    }
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。