javax.persistence.NamedStoredProcedureQueries Java Examples

The following examples show how to use javax.persistence.NamedStoredProcedureQueries. 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 vote down vote up
private NamedStoredProcedureQueries getNamedStoredProcedureQueries(Element tree, XMLContext.Default defaults) {
	List<NamedStoredProcedureQuery> queries = buildNamedStoreProcedureQueries( tree, defaults, classLoaderAccess );
	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;
	}
}
 
Example #2
Source File: AnnotationBinder.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
private static void bindNamedStoredProcedureQueries(NamedStoredProcedureQueries annotation, MetadataBuildingContext context, boolean isDefault) {
	if ( annotation != null ) {
		for ( NamedStoredProcedureQuery queryAnnotation : annotation.value() ) {
			bindNamedStoredProcedureQuery( queryAnnotation, context, isDefault );
		}
	}
}