Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A sample code integration mybatis generator, mybatis dynamic sql, spring-boot

NotificationsYou must be signed in to change notification settings

vran-dev/mybatis-dynamic-sql-integration-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

A sample code integration mybatis generator, mybatis dynamic sql, spring-boot.

integration features

  • Generate Entity from database by run Gradle Taskdao:mybatisGenerate
  • Auto migration database DDL or DML by flyway
  • Integration Lombok and MapStruct to simplify the code
  • Integration Mybatis-Dynamic-SQL and shows how write complicated DSL SQL

Build

environment

Run

  1. First: modifyapi/resources/application.yml
spring:datasource:driver-class-name:com.mysql.cj.jdbc.Driverurl:jdbc:mysql://{your database url}/{your database name}username:{ your database username }password:{ your database password }
  1. Second: modifydao/resources/generatorConfiguration.xml
<generatorConfiguration>    <contextid="dsql"targetRuntime="MyBatis3DynamicSql"><!-- ......-->        <jdbcConnectiondriverClass="com.mysql.cj.jdbc.Driver"connectionURL="jdbc:mysql://{your database url}/{your database name}"userId="{your database username}"password="{your database password}"/><!-- ......-->    </context></generatorConfiguration>
  1. Run Main classapi/java/cc/cc1234/api/Application.java

Module

module-relation

API

MethodEndPointRequest BodyDescription
POST/v1/api/user{"username":"hello", "gender":"MALE"}create user
DELETE/v1/api/users/{userId}N/Adelete user
PATCH/v1/api/users/{userId}{"username":"hello", "gender":"MALE"}update user basic information
GET/v1/api/users?page=1&size=20N/Alist users
GET/v1/api/users/{userId}/goods/purchasedN/Aquery user purchased goods

About

A sample code integration mybatis generator, mybatis dynamic sql, spring-boot

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp