mybatis / cdi

MyBatis CDI Extension
Apache License 2.0
25 stars 19 forks source link

missing @Any qualifier on MybatisBean if user provided qualifier is present #430

Open hktmyzk opened 10 months ago

hktmyzk commented 10 months ago

Hello,

After reviewing MyBatisBean.java, it appears that the @Any annotation will not be assigned to the bean if a qualifier is present at the injection point.

On line 71:

    if (qualifiers == null || qualifiers.isEmpty()) {
      this.qualifiers = new HashSet<>();
      this.qualifiers.add(new CDIUtils.SerializableDefaultAnnotationLiteral());
      this.qualifiers.add(new CDIUtils.SerializableAnyAnnotationLiteral());
    } else {
      this.qualifiers = qualifiers;
    }

If no qualifiers are found, the @Any annotation will be added. However, if qualifiers are found, the @Any annotation will not be added.

I believe the @Any qualifier should be added regardless.

Thanks.