use of org.apache.cayenne.map.ProcedureParameter in project cayenne by apache.
the class ProcedureParameterDisplayEventType method getLastProcedureParameters.
protected ProcedureParameter[] getLastProcedureParameters(Procedure procedure) {
List<ProcedureParameter> procedureParameterList = new ArrayList<ProcedureParameter>();
ProcedureParameter[] parameters = new ProcedureParameter[0];
String procedureParams = preferences.getProcedureParams();
if (procedureParams.isEmpty()) {
return procedureParameterList.toArray(parameters);
}
for (String procedureParamName : procedureParams.split(",")) {
for (ProcedureParameter procedureParameter : procedure.getCallParameters()) {
if (procedureParameter.getName().equals(procedureParamName)) {
procedureParameterList.add(procedureParameter);
}
}
}
return procedureParameterList.toArray(parameters);
}
use of org.apache.cayenne.map.ProcedureParameter in project cayenne by apache.
the class ProcedureParameterDisplayEventType method fireLastDisplayEvent.
@Override
public void fireLastDisplayEvent() {
DataChannelDescriptor dataChannel = (DataChannelDescriptor) controller.getProject().getRootNode();
if (!dataChannel.getName().equals(preferences.getDomain())) {
return;
}
DataMap dataMap = dataChannel.getDataMap(preferences.getDataMap());
if (dataMap == null) {
return;
}
Procedure procedure = dataMap.getProcedure(preferences.getProcedure());
if (procedure == null) {
return;
}
ProcedureDisplayEvent procedureDisplayEvent = new ProcedureDisplayEvent(this, procedure, dataMap, dataChannel);
controller.fireProcedureDisplayEvent(procedureDisplayEvent);
ProcedureParameter[] procedureParameters = getLastProcedureParameters(procedure);
ProcedureParameterDisplayEvent procedureParameterDisplayEvent = new ProcedureParameterDisplayEvent(this, procedureParameters, procedure, dataMap, dataChannel);
controller.fireProcedureParameterDisplayEvent(procedureParameterDisplayEvent);
}
Aggregations