{"id":20608953,"url":"https://github.com/mybatis/mybatipse","last_synced_at":"2025-04-06T05:18:12.817Z","repository":{"id":13818129,"uuid":"16514585","full_name":"mybatis/mybatipse","owner":"mybatis","description":"Eclipse plugin adding support for MyBatis SQL Mapper Framework.","archived":false,"fork":false,"pushed_at":"2023-07-02T11:04:54.000Z","size":2096,"stargazers_count":334,"open_issues_count":7,"forks_count":92,"subscribers_count":44,"default_branch":"master","last_synced_at":"2025-03-30T04:09:13.595Z","etag":null,"topics":["eclipse","eclipse-plugin","java","mybatis","plugin"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mybatis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-02-04T14:44:50.000Z","updated_at":"2024-11-22T06:37:41.000Z","dependencies_parsed_at":"2024-11-16T11:04:26.053Z","dependency_job_id":null,"html_url":"https://github.com/mybatis/mybatipse","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mybatis%2Fmybatipse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mybatis%2Fmybatipse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mybatis%2Fmybatipse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mybatis%2Fmybatipse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mybatis","download_url":"https://codeload.github.com/mybatis/mybatipse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247436451,"owners_count":20938566,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eclipse","eclipse-plugin","java","mybatis","plugin"],"created_at":"2024-11-16T10:12:19.016Z","updated_at":"2025-04-06T05:18:12.792Z","avatar_url":"https://github.com/mybatis.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"MyBatipse : Eclipse plugin for MyBatis\n=======\n\n[MyBatis](http://mybatis.org/) is a popular SQL Mapper framework.  \nAnd __MyBatipse__ is an Eclipse plug-in which provids content assists and validations when editing MyBatis related files.\n\n## Features\n\n### XML Editor Enhancements\n#### Auto-completion\n\n- Mapper namespace : Calculated from the path.  \n![autocomplete namespace](screen/ac-ns1.png)![autocomplete namespace](screen/ac-ns2.png)\n- Java class/Type alias : Propose Java classes and Type Aliases (translucent icons). Camelcase match is supported. [1] [2]  \n![autocomplete class](screen/ac-class.png) ![autocomplete class](screen/ac-class-cc.png)\n- Java property : Propose properties of the parent java class. Nested properties are supported.  \n![autocomplete property](screen/ac-prop1.png) ![autocomplete property](screen/ac-prop2.png)\n- Statement ID : If corresponding mapper interface exists, propose the method name as a statement ID.  \n![autocomplete statement id](screen/ac-stmt.png)\n- Reference to resultMap/select/sql : Propose ID of the referenced resultMap/select/sql. External reference is supported (blue icons).  \n![autocomplete reference](screen/ac-ref.png)\n- Parameter properties : #{} and ${} in select/insert/udpate/delte statements. Also works in some attributes.  \n![autocomplete properties](screen/ac-stmt-prop-xml.png) ![autocomplete properties 2](screen/ac-prop-test.png)\n- javaType, jdbcType, typeHandler in #{}  \n![autocomplete jdbcType](screen/ac-jdbc-type.png)\n- Result elements in resultMap/collection/association : Generates \u003cresult /\u003e elements for the parent java class properties.  \n![autocomplete results](screen/ac-results.png)\n- setting name and value in XML config.  \n![autocomplete setting](screen/ac-setting-name.png) ![autocomplete setting](screen/ac-setting-value.png)\n\n\n- __[1]__ For better performance, classes in the application libraries (loaded as JARs) are listed only when at least one package segment is specified.\n- __[2]__ There is a limitation for the type alias support. Basically, if type aliases are registered using Java API, they are not automatically detected. As a workaround, you can register type aliases in MyBatipse's preference. See the _Configuration_ section.\n\n#### Hyperlinks\n- To referenced resultMap/select/sql element. External reference is supported.  \n![link to external reference](screen/hl-refid.png)\n- From Java mapper interface to XML mapper element.  \n![link to xml mapper](screen/hl-xml-mapper.png)  \n- From Java mapper method to XML mapper element.  \n![link to xml statement](screen/hl-xml-statement.png)  \n- From XML statement id to Java mapper method.  \n![link to java method](screen/hl-java-method.png)\n- Result map id or select statement id specified in Java annotation.\n\n\n#### Validation\n- Missing TypeAlias, Java class/property.\n- Missing resultMap/select/sql ID. \n- etc.   \n![refid error](screen/err-refid.png)\n![problem view](screen/prblm-view.png)\n\n#### Mapper Declaration View\n- This feature is ported from [MyBatis Editor plugin](https://code.google.com/a/eclipselabs.org/p/mybatiseditor/) by @peterhendriks .  \n![sqlview xml](screen/sqlview-xml.png)\n![sqlview](screen/sqlview.png)\n\n### Java Editor Enhancements\n\n#### Auto-completion\n- Parameter properties : #{} and ${} in select/insert/udpate/delte annotations.\n![autocomplete properties in java](screen/ac-stmt-prop-java.png)  \n- Return type properties in ```@Result```  \n![autocomplete return type properties in java](screen/ac-result-prop-java.png)  \n- keyProperty in ```@Options``` and ```@SelectKey```  \n![autocomplete return type properties in java](screen/ac-options-keyprop-java.png)  \n![autocomplete return type properties in java](screen/ac-selkey-keyprop-java.png)  \n- javaType, jdbcType, typeHandler in #{}  : See the XML example.\n- Reference to resultMap in ```@ResultMap``` and resultMap attribute of ```@Arg```  \n![autocomplete resultmap annotation](screen/ac-rmap-java.png)  \n- select attribute of ```@Arg```, ```@Many``` and ```@One```  \n![autocomplete select](screen/ac-select-java.png) \n\n#### Quick Assist\n\nPut the cursor on the statement method name and press cmd + 1 (or ctrl + 1) to trigger Quick Assist.\n\n- You can add ```@Param``` to method parameters.  \n![param-annotation1](screen/qa-add-param1.png)  \n![param-annotation2](screen/qa-add-param2.png)  \n- You can copy annotation statement into the clipboard. \n![param-annotation1](screen/qa-copy-statement.png)  \n- You can move annotation statement to XML mapper.  \n![move-statement](screen/qa-move-statement.png)  \n- You can move `@Results` annotation to `\u003cresultMap /\u003e` in XML mapper.  \n![move-resultmap](screen/qa-move-resultmap.png)  \n\n#### Validation\n\n- `@ResultMap` : invalid resultMap ID.\n- `select` attribute of `@One` or `@Many` : invalid statement ID.\n\n### Rename Refactoring\n\n- Renaming resultMap/statement/sql ID updates its references in Java and XML mappers. \n- In XML mapper, right click -\u003e Refactor -\u003e Rename MyBatis element.\n![param-annotation1](screen/refactor-rename-xml.png)\n- In Java mapper, right click -\u003e MyBatis Refactor -\u003e Rename MyBatis element.\n![param-annotation1](screen/refactor-rename-java.png)\n- Renaming a Java mapper method also updates its references.\n\n\n### Miscellaneous\n\n- Wizard to create a new XML mapper file.  \n![wizard-xml-mapper](screen/wizard-xml-mapper.png)  \n- Smart-copy menu in Console View to copy SQL statement in an executable form. For example, if you select and copy the following debug output ...  \n![smart-copy-console](screen/smart-copy-console.png)  \n... and the following statement is copied to the clipboard (be sure to include the first `==\u003e` and `\u003c==` in the selection as the image above).\n\n  ```sql\n  insert into users values(2, 'User2')\n  ```\n\n\n## Configuration\n\n### XML mapper location\n- MyBatipse searches XML mapper files under your project's __Source Folder__. To make a directory __Source Folder__, right click the directory in the package explorer and choose __Build Path__ -\u003e __Use as Source Folder__ from the menu.\n\n### MyBatis Nature\n- By default, each file is validated when it's saved, but you would want to validate the XML mapper when the related Java classes are updated as well. For that purpose, MyBatipse provides a custom nature __MyBatis Nature__.  \nTo add the nature, right click the project in the package explorer and choose __Configure__ -\u003e __Add MyBatis Nature__ from the menu.   \n![nature](screen/nature.png)\n\n### Annotation Processing\n\n- To validate annotation value, you need to enable __annotation processing__. Open __Project__ -\u003e __Properties__ and select __Java Compiler__ -\u003e __Annotation Processing__ in the left column. Check both __Enable annotation processing__ and __Enable processing in editor__.\n\n### Type Alias\n- Type alias are automatically detected _if_ they are registered using XML config file (both mybatis and mybatis-spring config is supported).  \nIf you register type aliases in Java code, MyBatipse cannot detect them. As a workaround, you can register custom type aliases in the project setting (Open __Project__ -\u003e __Properties__ menu and select __MyBatipse__ from the left column).  \n![type aliases](screen/pref-alias.png)   \nFor example, with the above settings: \n  - The first entry registers all the classes in ```com.example.domain``` package as type aliases. You can use wildcard to specify multiple packages (e.g. `com.example.*.domain`).  \n  - The second entry registers the single class ```domain.Person```.  \n  - The third entry registers the single class ```domain.SomeLongNamedBean``` under the alias ```SomeBean```.\n  - Note that, in any case, MyBatipse respects ```@Alias``` annotation if it exists.\n\n### Java 8 `-parameters` compiler option support\n\n- If 'Store information about method parameters' option is enabled in the Java Compiler -\u003e Classfile Generation setting, MyBatipse proposes the declared method parameter names.  \n![xml proposal order](screen/actual-parameters.png)  \n\n\n## Tips\n- To move MyBatis proposals to the top of the XML proposal list, quit Eclipse and open the following file in the workspace: ```.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.xml.ui.prefs``` Find the line started with ```xml_content_assist_default_page_sort_order=``` and insert ```net.harawata.mybatis.proposalCategory.xml\\u0000``` right after the equal sign.  \n![xml proposal order](screen/xml-proposal-order.png)  \n\n\n\n## Installation\n\nThere are several ways to install MyBatipse.\n\n- Drag this button [![drag-to-install button](http://marketplace.eclipse.org/misc/installbutton.png)](http://marketplace.eclipse.org/marketplace-client-intro?mpc_install=1467819)  from browser to your Eclipse workbench (i.e. window).\n- Choose __Eclipse Marketplace...__ in __Help__ menu of your Eclipse and search __MyBatipse__.\n- Choose __Install New Software...__ in __Help__ menu and enter the following URL.  \nhttps://harawata.github.io/eclipse-site/\n- For offline installation, see [here](https://github.com/mybatis/mybatipse/issues/88#issuecomment-411817801).\n\n## Bugs, questions, suggestions, etc.\nPlease use the [issue tracker](https://github.com/harawata/mybatipse/issues).  \n\n\n## License\nMyBatipse is licensed under [__Eclipse Public License 1.0__](http://www.eclipse.org/legal/epl-v10.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmybatis%2Fmybatipse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmybatis%2Fmybatipse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmybatis%2Fmybatipse/lists"}