Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package org.domaframework.doma.intellij.common.validation.result
import com.intellij.codeInspection.ProblemsHolder
import com.intellij.openapi.util.TextRange
import com.intellij.psi.PsiElement
import org.domaframework.doma.intellij.bundle.MessageBundle
import org.domaframework.doma.intellij.common.psi.PsiParentClass
import org.domaframework.doma.intellij.common.util.DomaClassName

Expand All @@ -43,9 +44,21 @@ class ValidationMethodBiFunctionParamResult(

private fun getCheckParamIndexMessage(index: Int): String =
when (index) {
0 -> "The first type argument of BiFunction must be ${DomaClassName.CONFIG.className}"
1 -> "The second type argument of BiFunction must be ${DomaClassName.PREPARED_SQL.className}"
0 ->
MessageBundle.message(
"inspection.invalid.dao.sqlProcessor.params.biFunction.param.first",
DomaClassName.CONFIG.className,
)
1 ->
MessageBundle.message(
"inspection.invalid.dao.sqlProcessor.params.biFunction.param.second",
DomaClassName.PREPARED_SQL.className,
)

else -> "The type argument at index $index is not supported"
else ->
MessageBundle.message(
"inspection.invalid.dao.sqlProcessor.params.biFunction.param.invalid",
index,
)
}
}
5 changes: 4 additions & 1 deletion src/main/resources/messages/DomaToolsBundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ inspection.invalid.dao.params.require.type=When you annotate the method with @{0
inspection.invalid.dao.params.require.iterable.entity=The argument must be an Iterable subclass that has an Entity class as a parameter
inspection.invalid.dao.procedure.params.require.annotation=The parameters of the method annotated with @Function or @Procedure must be annotated with either of @In, @InOut, @Out or @ResultSet
inspection.invalid.dao.procedure.params.in.type={0} is not supported as the type of the parameter annotated with @In
inspection.invalid.dao.procedure.params.support.generic.param="{0}" is illegal as the type argument of "{1}"
inspection.invalid.dao.procedure.params.support.generic.param="{0}" is illegal as the type argument of "{1}"
inspection.invalid.dao.sqlProcessor.params.biFunction.param.first=The first type argument of BiFunction must be "{0}"
inspection.invalid.dao.sqlProcessor.params.biFunction.param.second=The second type argument of BiFunction must be "{0}"
inspection.invalid.dao.sqlProcessor.params.biFunction.param.invalid=The type argument at index {0} is not supported
5 changes: 4 additions & 1 deletion src/main/resources/messages/DomaToolsBundle_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ inspection.invalid.dao.returnType.psiTypes=\u623B\u308A\u5024\u306F"{0}"\u3067\u
inspection.invalid.dao.update.returnType.returning=\u300Creturning = @Returning\u300D\u304C\u6307\u5B9A\u3055\u308C\u305F\u5834\u5408\u3001\u623B\u308A\u5024\u306F"{0}"\u307E\u305F\u306F Optional<{0}>\u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093
inspection.invalid.dao.sqlProcessor.returnType.returning=\u623B\u308A\u5024"{0}"\u306F BiFunction \u306E 3 \u756A\u76EE\u306E\u578B\u5F15\u6570"{1}"\u3068\u540C\u3058\u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093
inspection.invalid.dao.multiInsert.returnType.returning=\u300Creturning = @Returning\u300D\u304C\u6307\u5B9A\u3055\u308C\u305F\u5834\u5408\u3001\u623B\u308A\u5024\u306F List<{0}>\u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093
inspection.invalid.dao.select.param.strategy.require.type=\u0040\u0053\u0065\u006C\u0065\u0063\u0074\u3067\u0073\u0074\u0072\u0061\u0074\u0065\u0067\u0079\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u0053\u0065\u006C\u0065\u0063\u0074\u0054\u0079\u0070\u0065\u002E\u007B\u0030\u007D\u3092\u6307\u5B9A\u3059\u308B\u5834\u5408\u3001\u30E1\u30BD\u30C3\u30C9\u306B\u007B\u0031\u007D\u578B\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u5FC5\u8981\u3067\u3059
inspection.invalid.dao.select.param.strategy.require.type=\u0040\u0053\u0065\u006C\u0065\u0063\u0074\u3067\u0073\u0074\u0072\u0061\u0074\u0065\u0067\u0079\u30AA\u30D7\u30B7\u30E7\u30F3\u306B\u0053\u0065\u006C\u0065\u0063\u0074\u0054\u0079\u0070\u0065\u002E{0}\u3092\u6307\u5B9A\u3059\u308B\u5834\u5408\u3001\u30E1\u30BD\u30C3\u30C9\u306B\u007B\u0031\u007D\u578B\u306E\u30D1\u30E9\u30E1\u30FC\u30BF\u304C\u5FC5\u8981\u3067\u3059
inspection.invalid.dao.select.param.notFound.strategy.stream=\u300Cjava.util.function.Function\u300D\u30D1\u30E9\u30E1\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B\u5834\u5408\u3001@Select\u306E\u6226\u7565\u8981\u7D20\u306BSelectStrategyType.STREAM\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
inspection.invalid.dao.returnType.immutable=@{0}\u304C\u4ED8\u4E0E\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9\u304C\u4E0D\u5909\u306A\u30A8\u30F3\u30C6\u30A3\u30C6\u30A3\u30AF\u30E9\u30B9\u3092\u5F15\u6570\u306B\u6301\u3064\u5834\u5408\u3001\u623B\u308A\u5024\u306F {1}<{2}>\u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093
inspection.invalid.dao.params.count=\u5F15\u6570\u306E\u6570\u306F1\u3064\u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093
Expand All @@ -33,3 +33,6 @@ inspection.invalid.dao.procedure.params.in.type=@In\u304C\u4ED8\u4E0E\u3055\u308
inspection.invalid.dao.procedure.params.support.generic.param="{0}"\u306F"{1}"\u306E\u578B\u5F15\u6570\u3068\u3057\u3066\u4E0D\u6B63\u3067\u3059
inspection.invalid.dao.returnType.invalid=\u623B\u308A\u5024\u0020\u0020"{0}"\u0020\u306F\u4E0D\u6B63\u3067\u3059
inspection.invalid.dao.select.returnType.strategy=\u623B\u308A\u5024\u306F\u300C{0}\u300D\u306E\u578B\u30D1\u30E9\u30E1\u30FC\u30BF\u306ERESULT\u3068\u4E00\u81F4\u3057\u3066\u3044\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
inspection.invalid.dao.sqlProcessor.params.biFunction.param.first=\u0042\u0069\u0046\u0075\u006E\u0063\u0074\u0069\u006F\u006E\u306E\u0031\u756A\u76EE\u306E\u8981\u7D20\u306F\u300C{0}\u300D\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
inspection.invalid.dao.sqlProcessor.params.biFunction.param.second=\u0042\u0069\u0046\u0075\u006E\u0063\u0074\u0069\u006F\u006E\u306E\u0032\u756A\u76EE\u306E\u8981\u7D20\u306F\u300C{0}\u300D\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059
inspection.invalid.dao.sqlProcessor.params.biFunction.param.invalid={0}\u756A\u76EE\u306E\u8981\u7D20\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ public interface SqlProcessorParamTestDao {

@SqlProcessor
@Sql("")
<R> R executeBiFunctionNotConfig(BiFunction<String,PreparedSql, R> <error descr="The first type argument of BiFunction must be org.seasar.doma.jdbc.Config">func</error>);
<R> R executeBiFunctionNotConfig(BiFunction<String,PreparedSql, R> <error descr="The first type argument of BiFunction must be \"org.seasar.doma.jdbc.Config\"">func</error>);

@SqlProcessor
<R> R executeBiFunctionNotPreparedSql(BiFunction<Config,String, R> <error descr="The second type argument of BiFunction must be org.seasar.doma.jdbc.PreparedSql">func</error>);

<R> R executeBiFunctionNotPreparedSql(BiFunction<Config,String, R> <error descr="The second type argument of BiFunction must be \"org.seasar.doma.jdbc.PreparedSql\"">func</error>);
@SqlProcessor
<R> R executeR(Integer id,BiFunction<Config, PreparedSql, Pckt> func);

Expand Down
Loading