use of org.dbflute.logic.jdbc.metadata.info.DfTypeArrayInfo in project dbflute-core by dbflute.
the class DfProcedureSupplementExtractorOracle method doResolveStructAttributeInfo.
protected void doResolveStructAttributeInfo(UnifiedSchema unifiedSchema, StringKeyMap<DfTypeStructInfo> structInfoMap, StringKeyMap<DfTypeArrayInfo> flatArrayInfoMap, DfTypeStructInfo structInfo, DfColumnMeta columnInfo) {
final String attrTypeName = columnInfo.getDbTypeName();
final DfTypeArrayInfo arrayInfo = doResolveStructAttributeArray(structInfoMap, flatArrayInfoMap, attrTypeName);
if (arrayInfo != null) {
// array attribute
columnInfo.setTypeArrayInfo(arrayInfo);
}
final DfTypeStructInfo nestedStructInfo = structInfoMap.get(attrTypeName);
if (nestedStructInfo != null) {
// nested struct
columnInfo.setTypeStructInfo(nestedStructInfo);
}
// for default mapping type
columnInfo.setProcedureParameter(true);
}
use of org.dbflute.logic.jdbc.metadata.info.DfTypeArrayInfo in project dbflute-core by dbflute.
the class DfArrayExtractorOracle method doExtractFlatArrayInfoSecondMap.
// ===================================================================================
// Second Array Info
// =================
protected StringKeyMap<DfTypeArrayInfo> doExtractFlatArrayInfoSecondMap(UnifiedSchema unifiedSchema) {
final StringKeyMap<DfTypeArrayInfo> flatArrayInfoMap = StringKeyMap.createAsFlexibleOrdered();
final List<DfProcedureArgumentInfo> argInfoList = extractProcedureArgumentInfoList(unifiedSchema);
for (int i = 0; i < argInfoList.size(); i++) {
final DfProcedureArgumentInfo argInfo = argInfoList.get(i);
final String argumentName = argInfo.getArgumentName();
if (Srl.is_Null_or_TrimmedEmpty(argumentName)) {
continue;
}
final String dataType = argInfo.getDataType();
if (!isDataTypeArray(dataType)) {
continue;
}
final String typeName = argInfo.getTypeName();
if (Srl.is_Null_or_TrimmedEmpty(typeName)) {
continue;
}
setupFlatArrayInfo(flatArrayInfoMap, argInfoList, argInfo, i);
}
final StringSet allArrayTypeSet = extractSimpleArrayNameSet(unifiedSchema);
for (String allArrayTypeName : allArrayTypeSet) {
if (!flatArrayInfoMap.containsKey(allArrayTypeName)) {
final DfTypeArrayInfo arrayInfo = new DfTypeArrayInfo(unifiedSchema, allArrayTypeName);
// the way to get the info is also unknown
arrayInfo.setElementType("Unknown");
flatArrayInfoMap.put(allArrayTypeName, arrayInfo);
}
}
return flatArrayInfoMap;
}
use of org.dbflute.logic.jdbc.metadata.info.DfTypeArrayInfo in project dbflute-core by dbflute.
the class DfArrayExtractorOracle method setupFlatArrayInfo.
protected void setupFlatArrayInfo(StringKeyMap<DfTypeArrayInfo> flatArrayInfoMap, List<DfProcedureArgumentInfo> argInfoList, DfProcedureArgumentInfo argInfo, int index) {
final UnifiedSchema owner = UnifiedSchema.createAsDynamicSchema(null, argInfo.getTypeOwner());
final String realTypeName = buildArrayTypeName(argInfo);
final DfTypeArrayInfo arrayInfo = new DfTypeArrayInfo(owner, realTypeName);
final boolean nestedArray = reflectArrayElementType(argInfoList, index, arrayInfo);
flatArrayInfoMap.put(realTypeName, arrayInfo);
if (nestedArray) {
final int nextIndex = (index + 1);
final DfProcedureArgumentInfo nextArgInfo = argInfoList.get(nextIndex);
// recursive call
setupFlatArrayInfo(flatArrayInfoMap, argInfoList, nextArgInfo, nextIndex);
}
}
use of org.dbflute.logic.jdbc.metadata.info.DfTypeArrayInfo in project dbflute-core by dbflute.
the class DfArrayExtractorOracle method doExtractFlatArrayInfoFirstMap.
// ===================================================================================
// First Array Info
// ================
protected StringKeyMap<DfTypeArrayInfo> doExtractFlatArrayInfoFirstMap(UnifiedSchema unifiedSchema) {
final List<Map<String, String>> resultList = selectFirstArray(unifiedSchema);
final StringKeyMap<DfTypeArrayInfo> arrayTypeMap = StringKeyMap.createAsFlexibleOrdered();
for (Map<String, String> map : resultList) {
final String typeName = buildArrayTypeName(map.get("TYPE_NAME"), unifiedSchema);
final DfTypeArrayInfo arrayInfo = new DfTypeArrayInfo(unifiedSchema, typeName);
// ARRAY and STRUCT only
final String elementTypeOwner = map.get("ELEM_TYPE_OWNER");
final String elementTypeName = map.get("ELEM_TYPE_NAME");
final String elementType = Srl.connectPrefix(elementTypeName, elementTypeOwner, ".");
arrayInfo.setElementType(elementType);
arrayTypeMap.put(typeName, arrayInfo);
}
return arrayTypeMap;
}
Aggregations