use of org.dbflute.logic.jdbc.metadata.info.DfTypeStructInfo in project dbflute-core by dbflute.
the class DfProcedurePmbSetupper method doProcessArrayProperty.
// -----------------------------------------------------
// Array Property
// --------------
protected String doProcessArrayProperty(DfTypeArrayInfo arrayInfo, ProcedurePropertyInfo propertyInfo) {
final String propertyType;
if (arrayInfo.hasNestedArray()) {
// array in array
final DfTypeArrayInfo nestedArrayInfo = arrayInfo.getNestedArrayInfo();
// recursive call
final String nestedType = doProcessArrayProperty(nestedArrayInfo, propertyInfo);
propertyType = getGenericListClassName(nestedType);
} else if (arrayInfo.hasElementStructInfo()) {
// struct in array
final DfTypeStructInfo structInfo = arrayInfo.getElementStructInfo();
propertyType = doProcessStructProperty(structInfo, propertyInfo);
} else {
// scalar in array
final String dbTypeName = arrayInfo.getElementType();
propertyType = findPlainPropertyType(Types.OTHER, dbTypeName, null, null);
}
arrayInfo.setElementJavaNative(propertyType);
return propertyType;
}
use of org.dbflute.logic.jdbc.metadata.info.DfTypeStructInfo 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.DfTypeStructInfo in project dbflute-core by dbflute.
the class DfProcedureExtractor method doResolveAssistInfoOracleToDBLink.
protected void doResolveAssistInfoOracleToDBLink(DfSchemaSource dataSource, List<DfProcedureMeta> metaInfoList, String dbLinkName) {
final DfProcedureSupplementExtractorOracle extractor = getSupplementExtractorOracle(dataSource);
// Overload
final Map<String, Integer> overloadInfoMapMap = extractor.extractParameterOverloadInfoToDBLinkMap(dbLinkName);
doSetupOverloadInfoOracleToDBLink(overloadInfoMapMap, metaInfoList, extractor);
// GreatWall
// DBLink procedure's GreatWalls are unsupported yet
// final StringKeyMap<DfTypeArrayInfo> parameterArrayInfoMap = extractor.extractParameterArrayInfoToDBLinkMap();
// final StringKeyMap<DfTypeStructInfo> structInfoMap = extractor.extractStructInfoToDBLinkMap();
// empty
final StringKeyMap<DfTypeArrayInfo> parameterArrayInfoMap = StringKeyMap.createAsFlexible();
// empty
final StringKeyMap<DfTypeStructInfo> structInfoMap = StringKeyMap.createAsFlexible();
doSetupGreatWallOracle(parameterArrayInfoMap, structInfoMap, metaInfoList, extractor);
}
use of org.dbflute.logic.jdbc.metadata.info.DfTypeStructInfo in project dbflute-core by dbflute.
the class DfProcedureExtractor method doResolveAssistInfoOracle.
// -----------------------------------------------------
// Oracle
// ------
protected void doResolveAssistInfoOracle(DfSchemaSource dataSource, List<DfProcedureMeta> metaInfoList) {
final UnifiedSchema mainSchema = dataSource.getSchema();
final List<UnifiedSchema> additionalSchemaList = getDatabaseProperties().getAdditionalSchemaList();
// overload
final DfProcedureSupplementExtractorOracle extractor = getSupplementExtractorOracle(dataSource);
final Map<UnifiedSchema, Map<String, Integer>> overloadInfoMapMap = newHashMap();
overloadInfoMapMap.put(mainSchema, extractor.extractParameterOverloadInfoMap(mainSchema));
for (UnifiedSchema additionalSchema : additionalSchemaList) {
overloadInfoMapMap.put(additionalSchema, extractor.extractParameterOverloadInfoMap(additionalSchema));
}
doSetupOverloadInfoOracle(overloadInfoMapMap, metaInfoList, extractor);
// great wall
// get all available schema's info to use other schema's type
// same-name type between schema is unsupported
final StringKeyMap<DfTypeArrayInfo> arrayInfoMap = extractor.extractParameterArrayInfoMap(mainSchema);
for (UnifiedSchema additionalSchema : additionalSchemaList) {
arrayInfoMap.putAll(extractor.extractParameterArrayInfoMap(additionalSchema));
}
final StringKeyMap<DfTypeStructInfo> structInfoMap = extractor.extractStructInfoMap(mainSchema);
for (UnifiedSchema additionalSchema : additionalSchemaList) {
structInfoMap.putAll(extractor.extractStructInfoMap(additionalSchema));
}
doSetupGreatWallOracle(arrayInfoMap, structInfoMap, metaInfoList, extractor);
// source info
// can get parameter definition code from Oracle
final boolean reflectParamsToHash = false;
doSetupSourceInfo(dataSource, metaInfoList, extractor, mainSchema, reflectParamsToHash);
for (UnifiedSchema additionalSchema : additionalSchemaList) {
doSetupSourceInfo(dataSource, metaInfoList, extractor, additionalSchema, reflectParamsToHash);
}
}
use of org.dbflute.logic.jdbc.metadata.info.DfTypeStructInfo in project dbflute-core by dbflute.
the class DfProcedureSupplementExtractorOracle method findParameterStructInfoMap.
protected StringKeyMap<DfTypeStructInfo> findParameterStructInfoMap(UnifiedSchema unifiedSchema) {
StringKeyMap<DfTypeStructInfo> structInfoMap = _structInfoMapMap.get(unifiedSchema);
if (structInfoMap != null) {
return structInfoMap;
}
// initialize per schema
final DfStructExtractorOracle extractor = new DfStructExtractorOracle(_dataSource, _suppressLogging);
structInfoMap = extractor.extractStructInfoMap(unifiedSchema);
// set up struct attribute's additional info
resolveStructAttributeInfo(unifiedSchema, structInfoMap);
log("Struct Info: " + unifiedSchema);
for (DfTypeStructInfo structInfo : structInfoMap.values()) {
log(" " + structInfo.toString());
}
_structInfoMapMap.put(unifiedSchema, structInfoMap);
return _structInfoMapMap.get(unifiedSchema);
}
Aggregations