Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法自动识别java8的参数命名 #704

Closed
fzhyzamt opened this issue Jul 16, 2021 · 8 comments
Closed

无法自动识别java8的参数命名 #704

fzhyzamt opened this issue Jul 16, 2021 · 8 comments

Comments

@fzhyzamt
Copy link

IDEA版本:2021.1.3
插件版本:2.9.3-183-204

加了@Param注解的参数可以识别,但直接使用方法参数名的就会报红。
比如下边这个例子,可以识别productType,但识别不了uniqueCode;

public interface ExampleDao {
    void select(@Param("productType") Integer productType, String uniqueCode);
}
<select id="select">
    select 1
    from example
    where product_type = #{productType}
      and unique_code = #{uniqueCode} 
</select>
@gejun123456
Copy link
Owner

设置里面有个 useActualParamName 勾一下就好了
image

@qw52655265
Copy link

系统:MACOS
IDEA版本:2023.2
插件版本:3.2.7
JDK: zulu-jdk17
JDK version: 17

EditorRole selectByConditions(String name);

1bd7bf9c4264162ccf6b00852ec2755d

问题:一个参数的时候无法正常提示参数名
奇怪的点:
1、2个(含)参数以上时又可以正常提示
2、其他使用JDK8的版本项目(使用上面同一个jdk),插件配置勾选上图的选项,一个参数也能正常提示
3、idea配置:build-> complier -> java complier, 也有正常配置-parameters参数

麻烦大大帮忙解答一下 @gejun123456

@gejun123456
Copy link
Owner

估计你是单个参数没加@param注解,新版本的mybatis确实是支持这种,插件还没弄支持,单参数可以加个@param注解或者等插件以后弄个兼容

@juoliii
Copy link

juoliii commented Dec 19, 2023

@gejun123456 插件啥时候能兼容下这个啊,被这个问题弄的头疼

@gejun123456
Copy link
Owner

下个版本优化下

@gejun123456
Copy link
Owner

支持mybatis3 5 2ognl可以使用任意名字引用

@gejun123456
Copy link
Owner

群文件已支持,估计这周发布正式版

@gejun123456
Copy link
Owner

#927

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants