Git Product home page Git Product logo

mybatisx's People

Contributors

firekirin67 avatar huayanyu avatar jidaojiuyou avatar ls9527 avatar makejavas avatar nieqiurong avatar qmdx avatar xjinyao avatar yuxiaobin avatar zzyandzzy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mybatisx's Issues

module path问题

单击module path输入框后弹出 choose module,选择模块后module path输入框值不变
version:1.5.2

idea 2021.2 ultimate edition build #IU-212.4746.92 版本,mybatisX 版本1.5.0,从mapper接口点击跳转到xml文件时报错

java.lang.ClassCastException: class com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl cannot be cast to class com.intellij.psi.PsiLiteralExpression (com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl and com.intellij.psi.PsiLiteralExpression are in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @af638fe)
at com.baomidou.plugin.idea.mybatisx.smartjpa.component.mapping.JpaMappingResolver.getTableNameByJpa(JpaMappingResolver.java:96)
at com.baomidou.plugin.idea.mybatisx.smartjpa.component.mapping.JpaAnnotationMappingResolver.findTableName(JpaAnnotationMappingResolver.java:31)
at com.baomidou.plugin.idea.mybatisx.smartjpa.component.mapping.EntityMappingResolverFactory.findTableName(EntityMappingResolverFactory.java:135)
at com.baomidou.plugin.idea.mybatisx.reference.PsiColumnReferenceSetResolver.getStartElement(PsiColumnReferenceSetResolver.java:135)
at com.baomidou.plugin.idea.mybatisx.reference.PsiColumnReferenceSetResolver.getStartElement(PsiColumnReferenceSetResolver.java:79)
at com.baomidou.plugin.idea.mybatisx.reference.PsiColumnReferenceSetResolver.resolve(PsiColumnReferenceSetResolver.java:70)
at com.baomidou.plugin.idea.mybatisx.reference.ContextPsiColumnReference.resolve(ContextPsiColumnReference.java:73)
at com.baomidou.plugin.idea.mybatisx.reference.ResultColumnReferenceSet.createReference(ResultColumnReferenceSet.java:44)
at com.intellij.psi.util.ReferenceSetBase.createReferences(ReferenceSetBase.java:74)
at com.intellij.psi.util.ReferenceSetBase.parse(ReferenceSetBase.java:55)
at com.intellij.psi.util.ReferenceSetBase.lambda$new$0(ReferenceSetBase.java:37)
at com.intellij.openapi.util.NotNullLazyValue$1.compute(NotNullLazyValue.java:56)
at com.intellij.openapi.util.NotNullLazyValue.getValue(NotNullLazyValue.java:32)
at com.intellij.psi.util.ReferenceSetBase.getReferences(ReferenceSetBase.java:84)
at com.intellij.psi.util.ReferenceSetBase.getPsiReferences(ReferenceSetBase.java:88)
at com.baomidou.plugin.idea.mybatisx.dom.converter.ColumnConverter.createReferences(ColumnConverter.java:49)
at com.intellij.util.xml.impl.GenericValueReferenceProvider.doCreateReferences(GenericValueReferenceProvider.java:108)
at com.intellij.util.xml.impl.GenericValueReferenceProvider.createReferences(GenericValueReferenceProvider.java:101)
at com.intellij.util.xml.impl.GenericValueReferenceProvider.getReferencesByElement(GenericValueReferenceProvider.java:60)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.getReferences(ReferenceProvidersRegistryImpl.java:199)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.mapNotEmptyReferencesFromProviders(ReferenceProvidersRegistryImpl.java:162)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.doGetReferencesFromProviders(ReferenceProvidersRegistryImpl.java:141)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.lambda$getReferencesFromProviders$0(ReferenceProvidersRegistry.java:39)
at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:158)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:39)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:227)
at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:42)
at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:227)
at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:111)
at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:43)
at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:68)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:228)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:28)
at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:72)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:155)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:121)
at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:38)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.getReferences(XmlAttributeValueImpl.java:80)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.getReferences(XmlAttributeValueImpl.java:90)
at com.intellij.codeInsight.highlighting.HyperlinkAnnotator.annotate(HyperlinkAnnotator.java:45)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.runAnnotators(DefaultHighlightVisitor.java:134)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:114)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.runVisitors(GeneralHighlightingPass.java:335)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$collectHighlights$5(GeneralHighlightingPass.java:268)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:294)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$6(GeneralHighlightingPass.java:297)
at com.intellij.codeInsight.daemon.impl.analysis.XmlHighlightVisitor.analyze(XmlHighlightVisitor.java:603)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:297)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$6(GeneralHighlightingPass.java:297)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:94)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:297)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectHighlights(GeneralHighlightingPass.java:265)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:211)
at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:84)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:56)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:399)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1078)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:392)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:705)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:647)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:63)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:391)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:367)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:174)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:183)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:365)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:188)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

当更改dao的返回类型时,如何快速更换xml对应id的resultType

现在遇到的问题是,当我修改方法返回类型时,没有选项能自动修改xml对应id的resultType,只有一个创建新statement的选项,这让我要重新复制粘贴一遍,还要把旧的删除,有点繁琐
image

希望能添加一个像是Free Mybatis plugin 中 correct resultType功能
image

default-all 的模板文件 mapperXml.ftl 中的 SQL 存在语法错误

问题1:插入 SQL 末尾多了个右括号
位置:位于 /src/main/resources/extensions/templates/default-all/mapperXml.ftl 的 34 行 166 列
image

问题2:多主键情况 where 条件缺少 and
位置:位于 /src/main/resources/extensions/templates/default-all/mapperXml.ftl 的 24 行 128 列、29 行 128 列、58 行 129 列、64 行 129 列
image

多层association标签是类型检查错误

在mybatis中使用多层association聚组时,插件无法正确识别当前层级的property属性

<resultMap id="query" type="a">
        <association property="a1" javaType="b">
            ……
            <association property="b1" javaType="c">
                ……
            </association>
        </association>
    </resultMap>

上述代码 插件会校验b1不属于a类型而不是b类型

java.lang.NoClassDefFoundError: com/intellij/aop/psi/AopPointcutExpressionFile

java.lang.NoClassDefFoundError: com/intellij/aop/psi/AopPointcutExpressionFile
at com.intellij.spring.model.xml.aop.PointcutExpressionConverter.fromString(PointcutExpressionConverter.java:32)
at com.intellij.spring.model.xml.aop.PointcutExpressionConverter.fromString(PointcutExpressionConverter.java:22)
at com.intellij.util.xml.impl.GetInvocation.getValueInner(GetInvocation.java:99)
at com.intellij.util.xml.impl.GetInvocation.getOrCalcValue(GetInvocation.java:74)
at com.intellij.util.xml.impl.GetInvocation.invoke(GetInvocation.java:62)
at com.intellij.util.xml.impl.DomInvocationHandler.invoke(DomInvocationHandler.java:660)
at com.intellij.util.xml.GenericAttributeValue$$EnhancerByJetBrainsMainCglib$$f4a47684.getValue()
at com.intellij.util.xml.highlighting.DomHighlightingHelperImpl.checkResolveProblems(DomHighlightingHelperImpl.java:127)
at com.intellij.util.xml.highlighting.BasicDomElementsInspection.checkDomElement(BasicDomElementsInspection.java:63)
at com.baomidou.plugin.idea.mybatisx.inspection.MapperXmlInspection.checkDomElement(MapperXmlInspection.java:27)
at com.intellij.util.xml.highlighting.DomElementsInspection$1.consume(DomElementsInspection.java:67)
at com.intellij.util.xml.highlighting.DomElementsInspection$1.consume(DomElementsInspection.java:63)
at com.intellij.util.xml.highlighting.DomElementsInspection.checkChildren(DomElementsInspection.java:82)
at com.intellij.util.xml.highlighting.DomElementsInspection$1.consume(DomElementsInspection.java:66)
at com.intellij.util.xml.highlighting.DomElementsInspection$1.consume(DomElementsInspection.java:63)
at com.intellij.util.xml.highlighting.DomElementsInspection.checkChildren(DomElementsInspection.java:82)
at com.intellij.util.xml.highlighting.DomElementsInspection$1.consume(DomElementsInspection.java:66)
at com.intellij.util.xml.highlighting.DomElementsInspection$1.consume(DomElementsInspection.java:63)
at com.intellij.util.xml.highlighting.DomElementsInspection.checkChildren(DomElementsInspection.java:82)
at com.intellij.util.xml.highlighting.DomElementsInspection$1.consume(DomElementsInspection.java:66)
at com.intellij.util.xml.highlighting.DomElementsInspection$1.consume(DomElementsInspection.java:63)
at com.intellij.util.xml.highlighting.DomElementsInspection.checkFileElement(DomElementsInspection.java:70)
at com.intellij.util.xml.highlighting.DomElementAnnotationsManagerImpl.checkFileElement(DomElementAnnotationsManagerImpl.java:203)
at com.intellij.util.xml.highlighting.DomElementsInspection.checkDomFile(DomElementsInspection.java:143)
at com.intellij.util.xml.highlighting.DomElementsInspection.checkFile(DomElementsInspection.java:117)
at com.intellij.codeInspection.LocalInspectionTool$1.visitFile(LocalInspectionTool.java:145)
at com.intellij.psi.impl.source.xml.XmlFileImpl.accept(XmlFileImpl.java:57)
at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:64)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$7(LocalInspectionsPass.java:352)
at com.intellij.util.AstLoadingFilter.lambda$toComputable$2(AstLoadingFilter.java:172)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:130)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:119)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:109)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$10(LocalInspectionsPass.java:352)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:136)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1078)
at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:92)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:705)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:647)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:63)
at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:104)
at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:83)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:174)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:183)
at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:83)
at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

功能请求:期望模板变量能提供更多数据库字段信息

最近更新的 custom-model-swagger 模板很赞
期望模板变量字段信息能提供更多数据库字段信息
比如:

  1. 字段是否为空,方便判断生成swagger时加上 @NotNull@NotEmpty 注解
  2. 字段是否启用自增,方便自己写的domain也能像内置的那样支持设置 @TableId 的 type,ID生成方式

生成实体类时问题

生成实体类时如果没有填写relative package将导致实体类报名以“.”结尾,并且mapper.xml引用也将多出个"."
问题在于
com.baomidou.plugin.idea.mybatisx.generate.template.GenerateCode .generate(Project project,
GenerateConfig generateConfig,
Map<String, List> templateSettingMap,
DbTable dbTable,
String domainName,
String tableName) throws Exception
方法第89行
javaModelGeneratorConfiguration.setTargetPackage(generateConfig.getBasePackage() + "." + generateConfig.getRelativePackage());

未做空字符串判断直接进行了拼接
当然 如果在界面上填写了relative package可以规避

mybatisx插件的校验问题

当前使用版本(必填,否则不予处理)

mybatisx,没有版本

该问题是如何引起的?(确定最新版也有问题再提!!!)

这个校验去掉吧

重现步骤(如果有就写完整)

报错信息

111

mybatis-x 使用中的问题

当前使用版本(必须填写清楚,否则不予处理)

0.1.0

该问题是怎么引起的?(最新版上已修复的会直接close掉)

mybatis 3 官方对于Spring boot 可以在 application.yml 中对pojo 类进行别名配置,即:mybatis.type-aliases-package 会自动扫描指定包下的pojo 和mapper 中parameterType 和resultType 进行关联,但是mybatis-x 却提示异常,辛苦处理下

重现步骤

报错信息

生成代码问题

生成实体类时,package name 多出一个".",不知道为什么。
image
image

继承类里的父类无法跳转xml

当前使用版本(必填,否则不予处理)

mybatisX 1.4.6

该问题是如何引起的?(确定最新版也有问题再提!!!)

--------------分隔线 -----------------
mybatis generator生成器生成的两个文件:
BMapper.xml
BMapper.java

interface BMapper {
int deleteByPrimaryKey(Long id);

int insert(Dto record);

int insertSelective(Dto record);

Dto selectByPrimaryKey(Long id);

int updateByPrimaryKeySelective(Dto record);

int updateByPrimaryKey(Dto record);

}
--------------分隔线 -----------------
手动写的
AExtMapper.java
AExtMapper.xml

interface AExtMapper extends BMapper {
Integer complete(@param("dto") Dto dto);
}

重现步骤(如果有就写完整)

AExtMapper.java里的所有方法都可以跳转到xml文件内
BMapper.java里的方法跳转xml失效

报错信息

这里要适配MP的话就改动一下。

//TODO 这里要适配MP的话就改动一下。
Optional sqlSessionFactoryClazzOpt = JavaUtils.findClazz(project, MAPPER_ALIAS_PACKAGE_CLASS);
if (sqlSessionFactoryClazzOpt.isPresent()) {
Collection domBeans = springModel.getAllDomBeans();


This issue was generated by todo based on a TODO comment in 1aacae9. It's been assigned to @nieqiurong because they committed the code.

数据库类型tinyint(1)的时候映射错误

当数据库类型为tinyint(1)的时候映射成bool类型了,tinyint(2)的时候映射的是Byte类型的。为什么要将1位的时候映射为bool类型,这个是基于什么考虑的?其实很多时候一个字段标识可能不止2种状态,但是又不会超过2位数,这个时候数据库其实就没必要定义未tinyint(2),往往会定义为tinyint(1),此时映射成bool就错了。这个1位的时候可以映射为Byte,如果需要用bool,数据库可以定义成bit就好了。

Version 1.5.1, the plugin pops up an error message

This issue may be related to (#46).
Error message

com.intellij.diagnostic.PluginException: Inspection #MybatisXMapperMethodInspection has no description [Plugin: com.baomidou.plugin.idea.mybatisx]
	at com.intellij.codeInspection.ui.InspectionNodeInfo.<init>(InspectionNodeInfo.java:72)
	at com.intellij.codeInspection.ui.InspectionResultsView.createBaseRightComponentFor(InspectionResultsView.java:475)
	at com.intellij.codeInspection.ui.InspectionResultsView.showInRightPanel(InspectionResultsView.java:402)
	at com.intellij.codeInspection.ui.InspectionResultsView.syncRightPanel(InspectionResultsView.java:341)
	at com.intellij.codeInspection.ui.InspectionTree.lambda$new$0(InspectionTree.java:78)
	at java.desktop/javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:641)
	at com.intellij.ui.treeStructure.Tree$MySelectionModel.fireValueChanged(Tree.java:627)
	at java.desktop/javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1111)
	at java.desktop/javax.swing.tree.DefaultTreeSelectionModel.addSelectionPaths(DefaultTreeSelectionModel.java:415)
	at java.desktop/javax.swing.tree.DefaultTreeSelectionModel.addSelectionPath(DefaultTreeSelectionModel.java:313)
	at java.desktop/javax.swing.JTree.addSelectionPath(JTree.java:1769)
	at java.desktop/javax.swing.JTree.setExpandedState(JTree.java:3682)
	at java.desktop/javax.swing.JTree.collapsePath(JTree.java:2269)
	at com.intellij.ui.treeStructure.Tree.lambda$collapsePath$1(Tree.java:612)
	at java.base/java.util.ArrayDeque.forEach(ArrayDeque.java:889)
	at com.intellij.ui.treeStructure.Tree.collapsePath(Tree.java:612)
	at java.desktop/javax.swing.plaf.basic.BasicTreeUI.toggleExpandState(BasicTreeUI.java:2627)
	at java.desktop/javax.swing.plaf.basic.BasicTreeUI.handleExpandControlClick(BasicTreeUI.java:2601)
	at java.desktop/javax.swing.plaf.basic.BasicTreeUI.checkForClickInExpandControl(BasicTreeUI.java:2549)
	at java.desktop/javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(BasicTreeUI.java:4007)
	at java.desktop/javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(BasicTreeUI.java:3955)
	at com.intellij.util.ui.MouseEventAdapter.mousePressed(MouseEventAdapter.java:30)
	at java.desktop/java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:288)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6649)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
	at com.intellij.ui.treeStructure.Tree.processMouseEvent(Tree.java:394)
	at java.desktop/java.awt.Component.processEvent(Component.java:6417)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4544)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2784)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:885)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:814)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:751)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:441)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:440)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

插件使用时提示致命性错误

当前使用版本(必填,否则不予处理)

idea版本: 2020.2.1
mybatisx版本:1.1.2

该问题是如何引起的?(确定最新版也有问题再提!!!)

打开一个使用mybatis的项目,然后进入一个mapper.xml文件,过一会idea致命错误中就会提示错误,但是插件功能使用正常

重现步骤(如果有就写完整)

可以必现

报错信息

java.lang.NoSuchMethodError: 'java.util.Set com.intellij.spring.contexts.model.SpringModel.getModelsToProcess()'
at com.baomidou.plugin.idea.mybatisx.alias.BeanAliasResolver.getPackages(BeanAliasResolver.java:43)
at com.baomidou.plugin.idea.mybatisx.alias.PackageAliasResolver.getClassAliasDescriptions(PackageAliasResolver.java:33)
at com.baomidou.plugin.idea.mybatisx.alias.AliasFacade.findPsiClass(AliasFacade.java:61)
at com.baomidou.plugin.idea.mybatisx.alias.AliasClassReference.resolve(AliasClassReference.java:35)
at com.intellij.codeInspection.xml.DeprecatedClassUsageInspection.checkReferences(DeprecatedClassUsageInspection.java:46)
at com.intellij.codeInspection.xml.DeprecatedClassUsageInspection.access$000(DeprecatedClassUsageInspection.java:20)
at com.intellij.codeInspection.xml.DeprecatedClassUsageInspection$1.visitXmlAttributeValue(DeprecatedClassUsageInspection.java:37)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.accept(XmlAttributeValueImpl.java:46)
at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:65)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$6(LocalInspectionsPass.java:317)
at com.intellij.util.AstLoadingFilter.lambda$toComputable$2(AstLoadingFilter.java:168)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:126)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:115)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:110)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$7(LocalInspectionsPass.java:317)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1110)
at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:105)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:117)
at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:96)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:170)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:182)
at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:96)
at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)

tableClass.remark和field.remark在模板中无法解析并报错

我使用的是MySQL,并且每个字段都有注释

image

填充模板出错,FreeMarker template error: The following has evaluated to null or missing: ==> field.remark [in template "template" at line 27, column 10] Tip: It's the step after the last dot that caused this error, not those before it. Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? FTL stack trace ("~" means nesting-related): - Failed at: ${field.remark} [in template "template" at line 27, column 7] Java stack trace (for programmers): freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...] at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134) at freemarker.core.EvalUtil.coerceModelToTextualCommon(EvalUtil.java:479) at freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:401) at freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:370) at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:100) at freemarker.core.DollarVariable.accept(DollarVariable.java:63) at freemarker.core.Environment.visit(Environment.java:367) at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:321) at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271) at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:244) at freemarker.core.Environment.visitIteratorBlock(Environment.java:643) at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:108) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)

sql/resultMap/select with such name already exists

  • 加了个字段,然后使用mybatis-generator重新生成并覆盖原有的mapper和xml后,xml中的id会提示名称已存在;
  • 尝试重启idea不行
  • 清除idea缓存并重启也不行
  • 禁用mybatisX插件后,不提示错误了,但是再重新打开插件后又会提示错误
  • 只有在删除原有的mapper和xml后,再使用generator生成新的文件才能消除错误提示

微信截图_20210519123620

微信截图_20210519124011

插件安装好后,右键表不展示生成选项

idea版本:
IntelliJ IDEA 2018.2.5 (Ultimate Edition)
Build #IU-182.4892.20, built on October 16, 2018

插件重复安装,每次都重启,仍然不行
2021-09-06_150539
2021-09-06_150518

麻烦大佬,帮忙看下,是因为编辑器的版本问题吗?

Version 1.5.0, "Result type not match" points to the same type, and the plugin pops up an error message

operating system:
Windows 10 19043.1237
Plugin version:
1.5.0
idea version:
2021.2.2
Problem Description:
When MybatisX is enabled for the project, an error is reported when trying to solve the problem with the alt+enter key, and clearing the cache is still invalid.
This issue comes from the transfer of gitee.
Steps to reproduce
Operate alt+enter on the explosion of a mapper layer, and an IDE error message appears.
image
image

Error message

com.intellij.diagnostic.PluginException: Inspection #MybatisXMapperMethodInspection has no description [Plugin: com.baomidou.plugin.idea.mybatisx]
	at com.intellij.codeInspection.ui.InspectionNodeInfo.<init>(InspectionNodeInfo.java:72)
	at com.intellij.codeInspection.ui.InspectionResultsView.createBaseRightComponentFor(InspectionResultsView.java:475)
	at com.intellij.codeInspection.ui.InspectionResultsView.showInRightPanel(InspectionResultsView.java:402)
	at com.intellij.codeInspection.ui.InspectionResultsView.syncRightPanel(InspectionResultsView.java:341)
	at com.intellij.codeInspection.ui.InspectionTree.lambda$new$0(InspectionTree.java:78)
	at java.desktop/javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:641)
	at com.intellij.ui.treeStructure.Tree$MySelectionModel.fireValueChanged(Tree.java:627)
	at java.desktop/javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1111)
	at java.desktop/javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:297)
	at java.desktop/javax.swing.JTree.setSelectionPaths(JTree.java:1669)
	at java.desktop/javax.swing.JTree.setSelectionRows(JTree.java:1752)
	at java.desktop/javax.swing.JTree.setSelectionRow(JTree.java:1727)
	at com.intellij.util.ui.tree.TreeUtil.lambda$showAndSelect$10(TreeUtil.java:641)
	at com.intellij.util.ui.tree.TreeUtil.showAndSelect(TreeUtil.java:676)
	at com.intellij.util.ui.tree.TreeUtil.showAndSelect(TreeUtil.java:596)
	at com.intellij.util.ui.tree.TreeUtil.showAndSelect(TreeUtil.java:591)
	at com.intellij.util.ui.tree.TreeUtil.selectPath(TreeUtil.java:506)
	at com.intellij.util.ui.tree.TreeUtil.selectPath(TreeUtil.java:488)
	at com.intellij.codeInspection.ui.InspectionTree.selectNode(InspectionTree.java:232)
	at com.intellij.codeInspection.ui.InspectionViewNavigationPanel$1.doClick(InspectionViewNavigationPanel.java:67)
	at com.intellij.ui.components.labels.LinkLabel.doClick(LinkLabel.java:389)
	at com.intellij.ui.components.labels.LinkLabel$MyMouseHandler.mouseReleased(LinkLabel.java:363)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6652)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
	at java.desktop/java.awt.Component.processEvent(Component.java:6417)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2784)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:885)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:814)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:751)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:441)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:440)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

希望能增加自定义生成的ServiceImpl实现类名后缀的功能

现在生成的ServiceImpl实现类名称都是实体类+Service,如实体类名是Student,对应的查询实现类生成的是StudentService和StudentImpl,import进来后容易和业务层的service类相混淆
是否可以自定义“Service”这个后缀,最终生成类似StudentXXX格式的如StudentStorageService

查询参数带上In生成XML文件字段名不会转成下划线

例如Mapper写入:selectPhoneNoByUserIdIn
自动生成的XML为:

  <select id="selectPhoneNoByUserIdIn" resultMap="BaseResultMap">
    select phone_no
    from auth_real_name
    where
    userId in
    <foreach collection="userIdList" item="item" open="(" close=")" separator=",">
      #{item,jdbcType=VARCHAR}
    </foreach>
  </select>

userId没有转换为user_id

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.