Java Code Examples for javax.persistence.NamedStoredProcedureQuery#name()

The following examples show how to use javax.persistence.NamedStoredProcedureQuery#name() . 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: NamedProcedureCallDefinition.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
NamedProcedureCallDefinition(NamedStoredProcedureQuery annotation) {
	this.registeredName = annotation.name();
	this.procedureName = annotation.procedureName();
	this.hints = new QueryHintDefinition( annotation.hints() ).getHintsMap();
	this.resultClasses = annotation.resultClasses();
	this.resultSetMappings = annotation.resultSetMappings();

	this.parameterDefinitions = new ParameterDefinitions( annotation.parameters(), hints );

	final boolean specifiesResultClasses = resultClasses != null && resultClasses.length > 0;
	final boolean specifiesResultSetMappings = resultSetMappings != null && resultSetMappings.length > 0;

	if ( specifiesResultClasses && specifiesResultSetMappings ) {
		throw new MappingException(
				String.format(
						"NamedStoredProcedureQuery [%s] specified both resultClasses and resultSetMappings",
						registeredName
				)
		);
	}
}
 
Example 2
Source File: JPAOverriddenAnnotationReader.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
private void addNamedStoredProcedureQueryIfNeeded(NamedStoredProcedureQuery annotation, List<NamedStoredProcedureQuery> queries) {
	if ( annotation != null ) {
		String queryName = annotation.name();
		boolean present = false;
		for ( NamedStoredProcedureQuery current : queries ) {
			if ( current.name().equals( queryName ) ) {
				present = true;
				break;
			}
		}
		if ( !present ) {
			queries.add( annotation );
		}
	}
}