Code Monkey home page Code Monkey logo

groovy-script's Introduction

groovy-script

Generate JPA POJOs under IDEA intelliJ

How to Use:

1.Put this file under : C:\Users\Administrator.IntelliJIdea2017.1\config\extensions\com.intellij.database\schema\
This path can be found by following steps:
a. Open IDEA, right pannel,choose DataBase
b. Connect to currrent DB.
c. choose one table, Right click (on Windows),choose the "Scripted Extentions" -> "Go to Script Directory"
d. Open this directory in Explore. Back up the origional "Generate POJOs.groovy". Replace it with your downloaded file.
2. Use it just like it's the origional one!
Choose a DATATABLE, Right Click ," Scripted Extentions" -> Generate POJOs.groovy!

3.Caution:

a. The DB column which name is "id"(ignore the case) is recognized as Primary KEY ,annotated BY @Id
b. You Should OPEN this file , modify its VARIABLE according to your MODULE/PROJECT ,such as:
packageName,
beanName,
author, etc.
c. When comes to DB column type mapping to POJO, you should always perform a double CHECK!
This file is modified according to ORCALE DB SYSTEM.
About this, you should refer to :
http://blog.csdn.net/high2011/article/details/47701455

##简介

在SOA开发过程中,使用intelliJ IDEA 开发 JPA.需要根据table生成POJO,而且是带JPA 注解的POJO,例如@Entity @Column @Builder 之类. 目前的已有的generate POJO 工具只能生成bean.无法满足JPA POJO的需求.问题在于: 1.bean的属性需要配合项目,使用Camel Name法则 2.无JPA特性的注解 3.无继承Serializable接口和生成defaultSerialID

由于以上原因,可以看到通过网络搜索到的脚本没办法直接使用.因此自己修改生成了一个groovy脚本.能够生成满足自己使用.

##环境 windows下 IDEA IntelliJ. Mac下需要运行groovy脚本,对应的步骤需要修改.

groovy-script's People

Contributors

dacer250 avatar anandaanv avatar

Watchers

James Cloos 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.