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 = super.getAnnotation( NamedQuery.class );
addNamedQueryIfNeeded( annotation, queries );
NamedQueries annotations = super.getAnnotation( NamedQueries.class );
if ( annotations != null ) {
for ( NamedQuery current : annotations.value() ) {
addNamedQueryIfNeeded( current, queries );