use of org.apache.cayenne.map.Procedure in project cayenne by apache.
the class ProcedureColumnLoader method processResultSetRow.
@Override
protected void processResultSetRow(CatalogFilter catalog, SchemaFilter schema, DbLoadDataStore map, ResultSet rs) throws SQLException {
String procSchema = rs.getString("PROCEDURE_SCHEM");
String procCatalog = rs.getString("PROCEDURE_CAT");
String name = rs.getString("PROCEDURE_NAME");
String key = Procedure.generateFullyQualifiedName(procCatalog, procSchema, name);
Procedure procedure = map.getProcedure(key);
if (procedure == null) {
return;
}
ProcedureParameter column = loadProcedureParams(rs, key, procedure);
if (column == null) {
return;
}
procedure.addCallParameter(column);
}
use of org.apache.cayenne.map.Procedure in project cayenne by apache.
the class ProcedureLoader method processResultSetRow.
@Override
protected void processResultSetRow(CatalogFilter catalog, SchemaFilter schema, DbLoadDataStore map, ResultSet rs) throws SQLException {
PatternFilter filter = config.getFiltersConfig().proceduresFilter(catalog.name, schema.name);
String name = rs.getString("PROCEDURE_NAME");
if (!filter.isIncluded(name)) {
LOGGER.info("skipping Cayenne PK procedure: " + name);
return;
}
Procedure procedure = new Procedure(name);
procedure.setCatalog(rs.getString("PROCEDURE_CAT"));
procedure.setSchema(rs.getString("PROCEDURE_SCHEM"));
switch(rs.getShort("PROCEDURE_TYPE")) {
case DatabaseMetaData.procedureNoResult:
case DatabaseMetaData.procedureResultUnknown:
procedure.setReturningValue(false);
break;
case DatabaseMetaData.procedureReturnsResult:
procedure.setReturningValue(true);
break;
}
map.addProcedureSafe(procedure);
}
use of org.apache.cayenne.map.Procedure in project cayenne by apache.
the class ProcedureTab method setSchema.
void setSchema(String text) {
if (text != null && text.trim().length() == 0) {
text = null;
}
Procedure procedure = eventController.getCurrentProcedure();
if (procedure != null && !Util.nullSafeEquals(procedure.getSchema(), text)) {
procedure.setSchema(text);
eventController.fireProcedureEvent(new ProcedureEvent(this, procedure));
}
}
use of org.apache.cayenne.map.Procedure in project cayenne by apache.
the class ProcedureTab method initController.
private void initController() {
returnsValue.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
Procedure procedure = eventController.getCurrentProcedure();
if (procedure != null && !ignoreChange) {
procedure.setReturningValue(returnsValue.isSelected());
eventController.fireProcedureEvent(new ProcedureEvent(ProcedureTab.this, procedure));
}
}
});
eventController.addProcedureDisplayListener(this);
}
use of org.apache.cayenne.map.Procedure in project cayenne by apache.
the class ProcedureTab method setCatalog.
void setCatalog(String text) {
if (text != null && text.trim().length() == 0) {
text = null;
}
Procedure procedure = eventController.getCurrentProcedure();
if (procedure != null && !Util.nullSafeEquals(procedure.getCatalog(), text)) {
procedure.setCatalog(text);
eventController.fireProcedureEvent(new ProcedureEvent(this, procedure));
}
}
Aggregations