com.github.drinkjava2.jdialects
Class TableModelUtils

java.lang.Object
  extended by com.github.drinkjava2.jdialects.TableModelUtils

public abstract class TableModelUtils
extends Object

This utility tool should have below methods: entity2Model() method: Convert 1 entity class or annotated entity class to TableModel Objects entity2Models() method: Convert entity classes or annotated entity classes to TableModel Objects db2Models() method: Convert JDBC database to TableModels Models2Excel() method: Convert TableModel Objects to Excel CSV format text excel2Models() method: Convert Excel CSV format text to TableModel Objects Models2EntitySrc method: Convert TableModel Object to Annotated entity class Java Source code Model2ModelSrc method: Convert TableModel Objects to Java configuration, for example: TableModel t= new TableModel("tb"), t.column("col").LONG()...

Since:
1.0.5
Author:
Yong Zhu

Constructor Summary
TableModelUtils()
           
 
Method Summary
static TableModel[] db2Models(Connection con, Dialect dialect)
          Convert JDBC connected database structure to TableModels, note:
1)This method does not close connection, do not forgot close it later
2)This method does not support sequence, foreign keys, primary keys..., only read the database structure, but in future version may support
static TableModel entity2Model(Class<?> entityClass)
          Convert entity class or JPA annotated entity class to "TableModel" Object, if class have a "config(TableModel tableModel)" method, will also call it.
static TableModel[] entity2Models(Class<?>... entityClasses)
          Convert entity or JPA annotated entity classes to "TableModel" Object, if these classes have a "config(TableModel tableModel)" method, will also call it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableModelUtils

public TableModelUtils()
Method Detail

entity2Model

public static TableModel entity2Model(Class<?> entityClass)
Convert entity class or JPA annotated entity class to "TableModel" Object, if class have a "config(TableModel tableModel)" method, will also call it. This method support annotations on entity class, detail see README.md.

Parameters:
entityClass -
Returns:
TableModel

entity2Models

public static TableModel[] entity2Models(Class<?>... entityClasses)
Convert entity or JPA annotated entity classes to "TableModel" Object, if these classes have a "config(TableModel tableModel)" method, will also call it. This method support Annotations on entity class, detail see README.md.

Parameters:
entityClasses -
Returns:
TableModel

db2Models

public static TableModel[] db2Models(Connection con,
                                     Dialect dialect)
Convert JDBC connected database structure to TableModels, note:
1)This method does not close connection, do not forgot close it later
2)This method does not support sequence, foreign keys, primary keys..., only read the database structure, but in future version may support



Copyright © 2018. All rights reserved.