javax.persistence.NamedQueries Java Examples
The following examples show how to use
javax.persistence.NamedQueries.
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: JPAOverriddenAnnotationReader.java From lams with GNU General Public License v2.0 | 6 votes |
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, classLoaderAccess ); 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; } }
Example #2
Source File: QueryBinder.java From lams with GNU General Public License v2.0 | 5 votes |
public static void bindQueries(NamedQueries queriesAnn, MetadataBuildingContext context, boolean isDefault) { if ( queriesAnn == null ) { return; } for (NamedQuery q : queriesAnn.value()) { bindQuery( q, context, isDefault ); } }
Example #3
Source File: QueryBinder.java From lams with GNU General Public License v2.0 | 5 votes |
public static void bindQueries( org.hibernate.annotations.NamedQueries queriesAnn, MetadataBuildingContext context) { if ( queriesAnn == null ) { return; } for (org.hibernate.annotations.NamedQuery q : queriesAnn.value()) { bindQuery( q, context ); } }
Example #4
Source File: CreateXAnnotations.java From hyperjaxb3 with BSD 2-Clause "Simplified" License | 5 votes |
public XAnnotation<?> createNamedQueries( Collection<NamedQuery> cNamedQueries) { return transform( NamedQueries.class, javax.persistence.NamedQuery.class, cNamedQueries, new Transformer<NamedQuery, XAnnotation<javax.persistence.NamedQuery>>() { public XAnnotation<javax.persistence.NamedQuery> transform( NamedQuery input) { return createNamedQuery(input); } }); }