Eclipse plugin adding support for MyBatis SQL Mapper Framework.
MyBatis is a popular SQL Mapper framework.
And MyBatipse is an Eclipse plug-in which provids content assists and validations when editing MyBatis related files.
Mapper namespace : Calculated from the path.
Java class/Type alias : Propose Java classes and Type Aliases (translucent icons). Camelcase match is supported. [1] [2]
Java property : Propose properties of the parent java class. Nested properties are supported.
Statement ID : If corresponding mapper interface exists, propose the method name as a statement ID.
Reference to resultMap/select/sql : Propose ID of the referenced resultMap/select/sql. External reference is supported (blue icons).
Parameter properties : #{} and ${} in select/insert/udpate/delte statements. Also works in some attributes.
javaType, jdbcType, typeHandler in #{}
Result elements in resultMap/collection/association : Generates
setting name and value in XML config.
[1] For better performance, classes in the application libraries (loaded as JARs) are listed only when at least one package segment is specified.
[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.
@Result
@Options
and @SelectKey
@ResultMap
and resultMap attribute of @Arg
@Arg
, @Many
and @One
Put the cursor on the statement method name and press cmd + 1 (or ctrl + 1) to trigger Quick Assist.
@Param
to method parameters.@Results
annotation to <resultMap />
in XML mapper.@ResultMap
: invalid resultMap ID.select
attribute of @One
or @Many
: invalid statement ID.Wizard to create a new XML mapper file.
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 ...
... and the following statement is copied to the clipboard (be sure to include the first ==>
and <==
in the selection as the image above).
insert into users values(2, 'User2')
com.example.domain
package as type aliases. You can use wildcard to specify multiple packages (e.g. com.example.*.domain
).domain.Person
.domain.SomeLongNamedBean
under the alias SomeBean
.@Alias
annotation if it exists.-parameters
compiler option support.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.There are several ways to install MyBatipse.
Please use the issue tracker.
MyBatipse is licensed under Eclipse Public License 1.0.