Coder Social home page Coder Social logo

javageneratingmodel's Introduction

JavaGeneratingModel

Generate POJO or Bean java files based on database using java.

IDE:

IntelliJ IDEA 2017.2.6 x64

JDK:

JDK1.8.0_201

Directory tree

└─src
    └─com
        └─ren
            ├─model
            │      Column.java      # Data Table Column Model
            │      Table.java       # Table Model
            │      
            ├─service
            │      GetModel.java    # Output POJO or Bean java files based on database connections
            │      
            └─test
                    Test.java

Explain:

Sometimes I create models based on table information in the database. This tool automatically generates all models based on a database connection. You can generate POJOs that contain only attributes and getter and setter methods. You can also generate JavaBeans, it contain Non-parametric constructor and implement Serializable.

How to use

1、Import jar getmodel-1.0.jar or use this project.

2、You can refer to the example src/com/ren/test/Test.java

	//File output path
       	String path = "H:\\pojo";
        //conn : Database Connection
        GetModel getModel  = new GetModel(conn);
        /*
        Description:
            pojo: Contains attributes and getter、setter
            bean: Contains properties and getters, setters and no-argument constructors, and implements the Serializable interface
         */
        //Generate pojo to path
        //getModel.generatePojo(path);
        //Generate pojo to path and add package information "package com.ren.model" in pojo
        //getModel.generatePojo(path, "com.ren.model");
        //Generate Bean to path
        //getModel.generateBean(path);
        //Generate a bean to the path and add the package information "package com.ren.bean" to the bean.
        //getModel.generateBean(path, "com.ren.bean");

javageneratingmodel's People

Contributors

renhongqiang avatar

Stargazers

Qiu avatar

Watchers

James Cloos avatar

javageneratingmodel's Issues

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.