Giter VIP home page Giter VIP logo

simple-pojo-generator's Introduction

Simple POJO Generator

You can generate the POJOs from the Excel ".xlsx" File and from database. The title of the first line is considered as the class attribute and the type of the attribute is determined by the value under of each column

Merged the commits from chanlen's fork

Usage

Generate from Excel ".xlsx" File

-gen xlsx -i the input ".xlsx" file [-o output directory]

e.g. java -jar Simple-POJO-Generator.jar -gen xlsx -i /home/chanllen/sample.xlsx -o /home/chanllen/tmp

Generate from Database

-gen db -host database_url(JDBC Conn String) [-u user] [-p passwd] [-drv jdbc.driver][-tables table1,table2,...]
You must specify the host, it must be a valid JDBC Connection string.
User defaults to "root", password defaults to an empty string.
This is designed to work with MySQL, but you can use it for other database systems, in order to do it you must specify the full Class name of the Driver (and it must be loaded in the classpath).
If you don't want to generate POJOs for all the tables of the Schema specified you can provide a comma-separated list of table names(no spaces).

simple-pojo-generator's People

Contributors

chanllen avatar lordscales91 avatar

Watchers

 avatar  avatar

Forkers

chanllen

simple-pojo-generator's Issues

User Library missing

After lot of trial and error I reached this point

D:\Simple-POJO-Generator-master\bin>java -jar Simple-POJO-Generator.jar -gen xlsx -i "input.xlsx" -o tmp
Exception in thread "main" org.apache.poi.POIXMLException: java.lang.reflect.InvocationTargetException
at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:62)
at org.apache.poi.POIXMLDocumentPart.read(POIXMLDocumentPart.java:456)
at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:174)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:278)
at util.xls.PojoXlsGenerator.generate(PojoXlsGenerator.java:64)
at util.xls.PojoXlsGenerator.main(PojoXlsGenerator.java:53)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.apache.poi.xssf.usermodel.XSSFFactory.createDocumentPart(XSSFFactory.java:60)
... 5 more
Caused by: java.lang.NoSuchMethodError: org.apache.xmlbeans.XmlOptions.setLoadEntityBytesLimit(I)Lorg/apache/xmlbeans/XmlOptions;
at org.apache.poi.POIXMLTypeLoader.(POIXMLTypeLoader.java:50)
at org.apache.poi.xssf.model.ThemesTable.(ThemesTable.java:84)
... 10 more

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.