use of org.dbflute.logic.jdbc.metadata.info.DfTypeArrayInfo in project dbflute-core by dbflute.
the class DfProcedurePmbSetupper method doProcessGreatWallOfOracleType.
protected String doProcessGreatWallOfOracleType(String pmbName, DfProcedureColumnMeta column, ProcedurePropertyInfo propertyInfo) {
final String propertyType;
if (column.isOracleTreatedAsArray() && column.hasTypeArrayInfo()) {
// here dbTypeName is "PL/SQL TABLE" or "TABLE" or "VARRAY"
// (it's not useful for type mapping, so search like this)
final DfTypeArrayInfo arrayInfo = column.getTypeArrayInfo();
propertyType = getGenericListClassName(doProcessArrayProperty(arrayInfo, propertyInfo));
} else if (column.isOracleStruct() && column.hasTypeStructInfo()) {
final DfTypeStructInfo structInfo = column.getTypeStructInfo();
propertyType = doProcessStructProperty(structInfo, propertyInfo);
} else {
propertyType = null;
}
return propertyType;
}
use of org.dbflute.logic.jdbc.metadata.info.DfTypeArrayInfo 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.DfTypeArrayInfo in project dbflute-core by dbflute.
the class DfProcedureSupplementExtractorOracle method doResolveStructAttributeArray.
protected DfTypeArrayInfo doResolveStructAttributeArray(StringKeyMap<DfTypeStructInfo> structInfoMap, StringKeyMap<DfTypeArrayInfo> flatArrayInfoMap, String attrTypeName) {
if (!flatArrayInfoMap.containsKey(attrTypeName)) {
return null;
}
final DfTypeArrayInfo foundInfo = flatArrayInfoMap.get(attrTypeName);
final DfTypeArrayInfo typeArrayInfo = new DfTypeArrayInfo(foundInfo.getUnifiedSchema(), foundInfo.getTypeName());
final String elementType = foundInfo.getElementType();
typeArrayInfo.setElementType(elementType);
if (flatArrayInfoMap.containsKey(elementType)) {
// array in array in ...
// recursive call
final DfTypeArrayInfo nestedArrayInfo = doResolveStructAttributeArray(structInfoMap, flatArrayInfoMap, elementType);
typeArrayInfo.setNestedArrayInfo(nestedArrayInfo);
} else if (structInfoMap.containsKey(elementType)) {
// struct in array in ...
final DfTypeStructInfo elementStructInfo = structInfoMap.get(elementType);
typeArrayInfo.setElementStructInfo(elementStructInfo);
}
return typeArrayInfo;
}
use of org.dbflute.logic.jdbc.metadata.info.DfTypeArrayInfo in project dbflute-core by dbflute.
the class DfProcedureSupplementExtractorOracle method findFlatArrayInfoMap.
// ===================================================================================
// Flat Array Info
// ===============
protected StringKeyMap<DfTypeArrayInfo> findFlatArrayInfoMap(UnifiedSchema unifiedSchema) {
StringKeyMap<DfTypeArrayInfo> flatArrayInfoMap = _flatArrayInfoMapMap.get(unifiedSchema);
if (flatArrayInfoMap != null) {
return flatArrayInfoMap;
}
final DfArrayExtractorOracle extractor = new DfArrayExtractorOracle(_dataSource, _suppressLogging);
flatArrayInfoMap = extractor.extractFlatArrayInfoMap(unifiedSchema);
_flatArrayInfoMapMap.put(unifiedSchema, flatArrayInfoMap);
// all arrays are registered
return _flatArrayInfoMapMap.get(unifiedSchema);
}
use of org.dbflute.logic.jdbc.metadata.info.DfTypeArrayInfo in project dbflute-core by dbflute.
the class DfProcedureSupplementExtractorOracle method processArrayNestedElement.
protected void processArrayNestedElement(UnifiedSchema unifiedSchema, final StringKeyMap<DfTypeArrayInfo> flatArrayInfoMap, DfTypeArrayInfo arrayInfo) {
// ARRAY element
final DfTypeArrayInfo foundInfo = flatArrayInfoMap.get(arrayInfo.getElementType());
if (foundInfo != null) {
final DfTypeArrayInfo nestedInfo = new DfTypeArrayInfo(foundInfo.getUnifiedSchema(), foundInfo.getTypeName());
nestedInfo.setElementType(foundInfo.getElementType());
arrayInfo.setNestedArrayInfo(nestedInfo);
// recursive call
processArrayNestedElement(unifiedSchema, flatArrayInfoMap, nestedInfo);
// *ARRAY type of additional schema is unsupported for now
}
// STRUCT element
final StringKeyMap<DfTypeStructInfo> structInfoMap = findParameterStructInfoMap(unifiedSchema);
final DfTypeStructInfo structInfo = structInfoMap.get(arrayInfo.getElementType());
if (structInfo != null) {
// the structInfo has already been resolved about nested objects
arrayInfo.setElementStructInfo(structInfo);
// *STRUCT type of additional schema is unsupported for now
}
}
Aggregations