GithubHelp home page GithubHelp logo

mnmbdd / yobatis Goto Github PK

View Code? Open in Web Editor NEW

This project forked from linbaiye/yobatis

0.0 0.0 0.0 3.8 MB

An IDEA plugin that makes using Mybatis-Generator easier.

JavaScript 6.19% TypeScript 70.00% CSS 6.09% HTML 17.72%

yobatis's Introduction

Yobatis简介

Yobatis是一款基于MybatisGenerator的IDEA插件,在MG的基础上二次开发和封装,快速生成基础的CURD方法;表结构发生变更只需要重新生成即可,Yobatis会保留dao层中手写的方法和xml中自定义的tag。
插件以Tool Window的形式呈现,只需要简单配置好数据库和文件生成路径即可:

按照上图配置好单击Generate就可以生成代码:
----->

详细介绍请访问Yobatis使用手册:https://linbaiye.github.io/yobatis-tour/

使用生成代码:

生成代码使用简单,假设Yobatis为表 create table employee(id bigint primary key auto_increment, name char(20), phone char(12)) 生成代码,下面是2个查询示例:

// 通过条件查询:select id, name, phone from emloyee where name = 'Alice' and phone is not null
List<Employee> list = employeeDao.selectList(EmployeeCriteria.nameEqualTo("Alice").andPhoneIsNotNull());
// 该方法不会返回null
for (Employee employee : list) {
  System.out.println(employee.toString());
}
// select id, name, phone from emloyee where id = 1;
Employee employee = employeeDao.selectOne(1L);
if (employee == null) {
  System.out.println('没有id为1的员工.');
} else {
  System.out.println('员工的信息为:' + employee.toString());
}

示例项目: https://github.com/linbaiye/yobatis-sample.git

安装

Yobatis当前只支持本地安装,请下载最新release并通过本地安装方式安装即可。

  • 当前只支持Mysql
  • java8+
  • idea 144.3600.7+ (15年中以后的release应该都可以)

yobatis's People

Contributors

linbaiye avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.