use of org.dbflute.logic.jdbc.metadata.info.DfProcedureColumnMeta in project dbflute-core by dbflute.
the class DfSchemaInitializerPostgreSQL method buildProcedureArgExpression.
protected String buildProcedureArgExpression(DfProcedureMeta metaInfo) {
final List<DfProcedureColumnMeta> metaInfoList = metaInfo.getProcedureColumnList();
final StringBuilder sb = new StringBuilder();
for (DfProcedureColumnMeta columnMetaInfo : metaInfoList) {
final String dbTypeName = columnMetaInfo.getDbTypeName();
final String columnName = columnMetaInfo.getColumnName();
final DfProcedureColumnType columnType = columnMetaInfo.getProcedureColumnType();
if (DfProcedureColumnType.procedureColumnReturn.equals(columnType)) {
continue;
}
if (sb.length() > 0) {
sb.append(", ");
}
sb.append(columnName);
if (DfProcedureColumnType.procedureColumnIn.equals(columnType)) {
sb.append(" in ");
} else if (DfProcedureColumnType.procedureColumnOut.equals(columnType)) {
sb.append(" out ");
} else if (DfProcedureColumnType.procedureColumnInOut.equals(columnType)) {
sb.append(" inout ");
} else {
sb.append(" ");
}
sb.append(dbTypeName);
}
return sb.toString();
}
use of org.dbflute.logic.jdbc.metadata.info.DfProcedureColumnMeta in project dbflute-core by dbflute.
the class DfSql2EntityTask method showParameterBean.
protected void showParameterBean() {
_log.info("* * * * * * * * *");
_log.info("* ParameterBean *");
_log.info("* * * * * * * * *");
final StringBuilder logSb = new StringBuilder();
final Map<String, DfPmbMetaData> pmbMetaDataMap = _sql2entityMeta.getPmbMetaDataMap();
for (Entry<String, DfPmbMetaData> pmbEntry : pmbMetaDataMap.entrySet()) {
final DfPmbMetaData pmbMetaData = pmbEntry.getValue();
logSb.append(pmbMetaData.getClassName());
if (pmbMetaData.hasSuperClassDefinition()) {
logSb.append(" extends ").append(pmbMetaData.getSuperClassName());
}
if (pmbMetaData.isRelatedToProcedure()) {
logSb.append(" (procedure");
if (pmbMetaData.isProcedureRefCustomizeEntity()) {
logSb.append(" with customize-entity");
}
logSb.append(")").append(ln());
final Map<String, DfProcedureColumnMeta> propertyNameColumnInfoMap = pmbMetaData.getPropertyNameColumnInfoMap();
for (Entry<String, DfProcedureColumnMeta> columnEntry : propertyNameColumnInfoMap.entrySet()) {
final DfProcedureColumnMeta columnInfo = columnEntry.getValue();
logSb.append(" ").append(columnInfo.getColumnNameDisp());
logSb.append(ln());
}
} else {
if (pmbMetaData.isTypedParameterBean()) {
logSb.append(" ").append(pmbMetaData.buildTypedDisp());
}
logSb.append(ln());
final Map<String, String> propertyNameTypeMap = pmbMetaData.getPropertyNameTypeMap();
final Map<String, String> propertyOptionMap = pmbMetaData.getPropertyNameOptionMap();
for (Entry<String, String> propEntry : propertyNameTypeMap.entrySet()) {
final String propertyName = propEntry.getKey();
final String propertyType = propEntry.getValue();
logSb.append(" ").append(propertyType).append(" ").append(propertyName);
final String optionDef = propertyOptionMap.get(propertyName);
if (Srl.is_NotNull_and_NotTrimmedEmpty(optionDef)) {
logSb.append(":").append(optionDef);
}
logSb.append(ln());
}
}
logSb.append(ln());
}
if (logSb.length() > 0) {
_log.info(ln() + logSb.toString().trim());
}
}
Aggregations