mybatis-generator-plugins | Set of plugins for the mybatis-generator | Generator Utils library
kandi X-RAY | mybatis-generator-plugins Summary
kandi X-RAY | mybatis-generator-plugins Summary
[Dependabot SemVer Compatibility] See the following project for a demo of most of these plugins: Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Generate the top level class
- Add the field for the given column
- Build inner class
- Add an alias for the table field
- Validates the properties
- Validate that the subpackage is valid
- Generate additional Java files for the given table
- Returns a DynamicSqlSupportClassGenerator
- Validates the plugin
- Initializes the interface
- Checks if the interface generated by the given interface
- Override this method to provide additionalJavaJavaFiles
- Updates the type of the example table
- Checks whether the base record class is generated by the user
- Gets the value of the wrapped getter method
- Validates that the plugin is valid
- Checks if the client is generated
- Checks if the plugin is valid
- Validates the properties of the plugin
- Checks if model class is generated
- Validates if the plugin name is valid
- Validates that the plugin name and column values are valid
- Validates the configuration
- Gets the model setter method
mybatis-generator-plugins Key Features
mybatis-generator-plugins Examples and Code Snippets
Community Discussions
Trending Discussions on mybatis-generator-plugins
QUESTION
Can you set custom suffix and naming rule mapper xml and interfaces in MyBatis Generator (MBG)?
For example, When generating mapper files for class Book. MBG generates mapper file BookMapper.xml and interface PartnerDao.java. However, I wish to change the suffix to something else, like BookMapperBase.xml or BookDaoBase.xml, and PartnerMapperBase.java or PartnerDaoBase.java.
The reason is, former colleagues were using BookMapper.xml for their hand-written sql statements and using the same name would cause confusion. Moreover, I do not wish to use generated mappers directly, but use custom mapper files that extend BookMapperBase.xml.
I have searched online and found some github projects and hot rod ORM, but is it really not supported by official Mybatis Generator? If not, what is your recommended alternative?
...ANSWER
Answered 2019-May-15 at 20:04There are a couple of options.
You could use a domain object renaming rule as documented here: http://www.mybatis.org/generator/configreference/domainObjectRenamingRule.html
If that doesn't work the way you want it to, you could write a MyBatis Generator plugin to change the names of the generated artifacts. There is an example here: https://github.com/mybatis/generator/blob/master/core/mybatis-generator-core/src/main/java/org/mybatis/generator/plugins/RenameExampleClassPlugin.java
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mybatis-generator-plugins
You can use mybatis-generator-plugins like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the mybatis-generator-plugins component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page