baomidou / mybatisx Goto Github PK
View Code? Open in Web Editor NEWMybatisX 快速开发插件 https://baomidou.com/pages/ba5b24
Home Page: https://baomidou.com/pages/ba5b24/
License: Apache License 2.0
MybatisX 快速开发插件 https://baomidou.com/pages/ba5b24
Home Page: https://baomidou.com/pages/ba5b24/
License: Apache License 2.0
单击module path输入框后弹出 choose module,选择模块后module path输入框值不变
version:1.5.2
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)
在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
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)
希望mybatisx-generator代码生成工具的配置能跟模块绑定,选择不同的模块自动变更配置
Spring Boot项目,当mapper.xml文件中包含resultMap时,出现Cannot resolve symbol ''
同时生成多张表,所有的表Model都与第一张表一样。
如题,如果使用sql标签中的sql是from xxx where xxx.id=7,select中的是select xxx.a,xxx.b时,在被其他include时,标签中的sql和中的sql都无法识别表和字段
最近更新的 custom-model-swagger
模板很赞
期望模板变量字段信息
能提供更多数据库字段信息
比如:
@NotNull
、@NotEmpty
注解@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可以规避
0.1.0
mybatis 3 官方对于Spring boot 可以在 application.yml 中对pojo 类进行别名配置,即:mybatis.type-aliases-package 会自动扫描指定包下的pojo 和mapper 中parameterType 和resultType 进行关联,但是mybatis-x 却提示异常,辛苦处理下
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失效
TODO
comment in 1aacae9. It's been assigned to @nieqiurong because they committed the code.当数据库类型为tinyint(1)的时候映射成bool类型了,tinyint(2)的时候映射的是Byte类型的。为什么要将1位的时候映射为bool类型,这个是基于什么考虑的?其实很多时候一个字段标识可能不止2种状态,但是又不会超过2位数,这个时候数据库其实就没必要定义未tinyint(2),往往会定义为tinyint(1),此时映射成bool就错了。这个1位的时候可以映射为Byte,如果需要用bool,数据库可以定义成bit就好了。
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)
mapper写了方法之后 generate mybatis sql 没反应
期待插件生成代码的功能能与generator的功能保持一致
能否添加一下保存配置功能,要不然每次都生成的package是generate,生成路径也得重新填写。
希望能加入sql 输出功能 ,把参数和sql合到一起显示
我使用的是MySQL,并且每个字段都有注释
填充模板出错,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)
mapper与model、xml都是自动生成的,xml中有对应的resultMap标签,Mapper上有@entity的注释
我想要给插件好评,但是不知道如何给!!!
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.
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)
详见我在这里给IDEA官方建的issue,里面有包含问题情况、示例代码。
Propagate Safe Delete doesn't work
我遇到问题的MyBatisX版本为1.5.2
现在生成的ServiceImpl实现类名称都是实体类+Service,如实体类名是Student,对应的查询实现类生成的是StudentService和StudentImpl,import进来后容易和业务层的service类相混淆
是否可以自定义“Service”这个后缀,最终生成类似StudentXXX格式的如StudentStorageService
社区版怎么试用插件代码生成功能?能否支持data navigator插件?
例如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
1.5.2 生成的实体类数据库int类型变成了Object(1.5.1是Integer),smallint类型变成了Integer(1.5.1是short)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.