Java 类javax.persistence.StoredProcedureParameter 实例源码

项目:lams    文件:NamedProcedureCallDefinition.java   
ParameterDefinitions(StoredProcedureParameter[] parameters) {
    if ( parameters == null || parameters.length == 0 ) {
        parameterStrategy = ParameterStrategy.POSITIONAL;
        parameterDefinitions = new ParameterDefinition[0];
    }
    else {
        parameterStrategy = StringHelper.isNotEmpty( parameters[0].name() )
                ? ParameterStrategy.NAMED
                : ParameterStrategy.POSITIONAL;
        parameterDefinitions = new ParameterDefinition[ parameters.length ];
        for ( int i = 0; i < parameters.length; i++ ) {
            // i+1 for the position because the apis say the numbers are 1-based, not zero
            parameterDefinitions[i] = new ParameterDefinition( i+1, parameters[i] );
        }
    }
}
项目:lams    文件:NamedProcedureCallDefinition.java   
ParameterDefinition(int position, StoredProcedureParameter annotation) {
    this.position = position;
    this.name = normalize( annotation.name() );
    this.parameterMode = annotation.mode();
    this.type = annotation.type();
}