use of org.dbflute.logic.jdbc.metadata.info.DfProcedureColumnMeta in project dbflute-core by dbflute.
the class DfProcedureExtractor method doSetupOverloadInfoOracle.
protected void doSetupOverloadInfoOracle(Map<UnifiedSchema, Map<String, Integer>> parameterOverloadInfoMapMap, List<DfProcedureMeta> metaInfoList, DfProcedureSupplementExtractorOracle extractor) {
for (DfProcedureMeta metaInfo : metaInfoList) {
final String catalog = metaInfo.getProcedureCatalog();
final String procedureName = metaInfo.getProcedureName();
final List<DfProcedureColumnMeta> columnList = metaInfo.getProcedureColumnList();
for (DfProcedureColumnMeta columnInfo : columnList) {
final String columnName = columnInfo.getColumnName();
final String key = extractor.generateParameterInfoMapKey(catalog, procedureName, columnName);
// Overload
if (columnInfo.getOverloadNo() == null) {
// if not exists (it might be set by other processes)
final UnifiedSchema procedureSchema = metaInfo.getProcedureSchema();
final Map<String, Integer> overloadMap = parameterOverloadInfoMapMap.get(procedureSchema);
if (overloadMap != null) {
final Integer overloadNo = overloadMap.get(key);
if (overloadNo != null) {
columnInfo.setOverloadNo(overloadNo);
}
}
}
}
}
}
use of org.dbflute.logic.jdbc.metadata.info.DfProcedureColumnMeta in project dbflute-core by dbflute.
the class DfProcedureExtractor method adjustPostgreSQLResultSetParameter.
protected void adjustPostgreSQLResultSetParameter(DfProcedureMeta procedureMetaInfo) {
if (!isDatabasePostgreSQL()) {
return;
}
final List<DfProcedureColumnMeta> columnMetaInfoList = procedureMetaInfo.getProcedureColumnList();
boolean existsResultSetParameter = false;
boolean existsResultSetReturn = false;
int resultSetReturnIndex = 0;
String resultSetReturnName = null;
int index = 0;
for (DfProcedureColumnMeta columnMetaInfo : columnMetaInfoList) {
final DfProcedureColumnType procedureColumnType = columnMetaInfo.getProcedureColumnType();
final String dbTypeName = columnMetaInfo.getDbTypeName();
if (procedureColumnType.equals(DfProcedureColumnType.procedureColumnOut)) {
if ("refcursor".equalsIgnoreCase(dbTypeName)) {
existsResultSetParameter = true;
}
}
if (procedureColumnType.equals(DfProcedureColumnType.procedureColumnReturn)) {
if ("refcursor".equalsIgnoreCase(dbTypeName)) {
existsResultSetReturn = true;
resultSetReturnIndex = index;
resultSetReturnName = columnMetaInfo.getColumnName();
}
}
++index;
}
if (existsResultSetParameter && existsResultSetReturn) {
// It is a precondition that PostgreSQL does not allow functions to have a result set return
// when it also has result set parameters (as an out parameter).
String name = procedureMetaInfo.buildProcedureLoggingName() + "." + resultSetReturnName;
log("...Removing the result set return which is unnecessary: " + name);
columnMetaInfoList.remove(resultSetReturnIndex);
}
}
use of org.dbflute.logic.jdbc.metadata.info.DfProcedureColumnMeta in project dbflute-core by dbflute.
the class DfProcedureExtractor method doSetupOverloadInfoOracleToDBLink.
protected void doSetupOverloadInfoOracleToDBLink(Map<String, Integer> parameterOverloadInfoMap, List<DfProcedureMeta> metaInfoList, DfProcedureSupplementExtractorOracle extractor) {
for (DfProcedureMeta metaInfo : metaInfoList) {
final String catalog = metaInfo.getProcedureCatalog();
final String procedureName = metaInfo.getProcedureName();
final List<DfProcedureColumnMeta> columnList = metaInfo.getProcedureColumnList();
for (DfProcedureColumnMeta columnInfo : columnList) {
final String columnName = columnInfo.getColumnName();
final String key = extractor.generateParameterInfoMapKey(catalog, procedureName, columnName);
// Overload
if (columnInfo.getOverloadNo() == null) {
// if not exists (it might be set by other processes)
final Integer overloadNo = parameterOverloadInfoMap.get(key);
if (overloadNo != null) {
columnInfo.setOverloadNo(overloadNo);
}
}
}
}
}
use of org.dbflute.logic.jdbc.metadata.info.DfProcedureColumnMeta in project dbflute-core by dbflute.
the class DfProcedureExtractor method doSetupGreatWallOracle.
// ===================================================================================
// Great Wall
// ==========
protected void doSetupGreatWallOracle(StringKeyMap<DfTypeArrayInfo> parameterArrayInfoMap, StringKeyMap<DfTypeStructInfo> structInfoMap, List<DfProcedureMeta> metaInfoList, DfProcedureSupplementExtractorOracle extractor) {
final Set<String> resolvedArrayDispSet = new LinkedHashSet<String>();
final Set<String> resolvedStructDispSet = new LinkedHashSet<String>();
for (DfProcedureMeta metaInfo : metaInfoList) {
final String catalog = metaInfo.getProcedureCatalog();
final String procedureName = metaInfo.getProcedureName();
final List<DfProcedureColumnMeta> columnList = metaInfo.getProcedureColumnList();
for (DfProcedureColumnMeta columnInfo : columnList) {
final String columnName = columnInfo.getColumnName();
final String key = extractor.generateParameterInfoMapKey(catalog, procedureName, columnName);
// Array
final DfTypeArrayInfo arrayInfo = parameterArrayInfoMap.get(key);
if (arrayInfo != null) {
resolvedArrayDispSet.add(arrayInfo.toString());
columnInfo.setTypeArrayInfo(arrayInfo);
}
// Struct
final String dbTypeName = columnInfo.getDbTypeName();
final DfTypeStructInfo structInfo = structInfoMap.get(dbTypeName);
if (structInfo != null) {
resolvedStructDispSet.add(structInfo.toString());
columnInfo.setTypeStructInfo(structInfo);
}
}
}
if (!resolvedArrayDispSet.isEmpty()) {
log("Array related to parameter: " + resolvedArrayDispSet.size());
for (String arrayInfo : resolvedArrayDispSet) {
log(" " + arrayInfo);
}
}
if (!resolvedStructDispSet.isEmpty()) {
log("Struct related to parameter: " + resolvedStructDispSet.size());
for (String structInfo : resolvedStructDispSet) {
log(" " + structInfo);
}
}
}
use of org.dbflute.logic.jdbc.metadata.info.DfProcedureColumnMeta in project dbflute-core by dbflute.
the class DfProcedureNativeTranslatorOracle method createDBLinkProcedureMeta.
protected DfProcedureMeta createDBLinkProcedureMeta(ProcedureNativeInfo nativeInfo, String dbLinkName) {
final DfProcedureMeta procedureMeta = new DfProcedureMeta();
setupProcedureName(nativeInfo, procedureMeta, dbLinkName);
final List<DfProcedureArgumentInfo> argInfoList = nativeInfo.getArgInfoList();
for (DfProcedureArgumentInfo argInfo : argInfoList) {
final DfProcedureColumnMeta columnMeta = new DfProcedureColumnMeta();
columnMeta.setColumnName(argInfo.getArgumentName());
setupProcedureColumnDataType(argInfo, columnMeta);
setupProcedureColumnInOutType(argInfo, columnMeta);
setupProcedureColumnSize(argInfo, columnMeta);
procedureMeta.addProcedureColumn(columnMeta);
}
// assist info (e.g. great walls) is not set here (set later)
return procedureMeta;
}
Aggregations