private NamedQueries getNamedQueries(Element tree, XMLContext.Default defaults) {
//TODO avoid the Proxy Creation (@NamedQueries) when possible
List<NamedQuery> queries = (List<NamedQuery>) buildNamedQueries( tree, false, defaults );
if ( defaults.canUseJavaAnnotations() ) {
NamedQuery annotation = getPhysicalAnnotation( NamedQuery.class );
addNamedQueryIfNeeded( annotation, queries );
NamedQueries annotations = getPhysicalAnnotation( NamedQueries.class );
if ( annotations != null ) {
for ( NamedQuery current : annotations.value() ) {
addNamedQueryIfNeeded( current, queries );
}
}
}
if ( queries.size() > 0 ) {
AnnotationDescriptor ad = new AnnotationDescriptor( NamedQueries.class );
ad.setValue( "value", queries.toArray( new NamedQuery[queries.size()] ) );
return AnnotationFactory.create( ad );
}
else {
return null;
}
}
JPAOverriddenAnnotationReader.java 文件源码
java
阅读 34
收藏 0
点赞 0
评论 0
项目:lams
作者:
评论列表
文章目录