|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.drinkjava2.jdialects.TableModelUtils
public abstract class TableModelUtils
This utility tool to translate Entity class / Database metaData / Excel(will add in future) file to TableModel
| Constructor Summary | |
|---|---|
TableModelUtils()
|
|
| Method Summary | |
|---|---|
static void |
bindGlobalModel(Class<?> entityClass,
TableModel tableModel)
This method bind a tableModel to a entity class, this is a global setting |
static void |
db2JavaSrcFiles(DataSource ds,
Dialect dialect,
boolean linkStyle,
boolean activeRecord,
String packageName,
String outputfolder)
Read database structure and write them to Java entity class source code |
static TableModel[] |
db2Models(Connection con,
Dialect dialect)
Convert database metaData to TableModels, note: 1)This method does not close connection, do not forgot close it later 2)This method does not read sequence, index, unique constraints |
static TableModel |
entity2Model(Class<?> entityClass)
Convert entity class to a editable TableModel instance |
static TableModel[] |
entity2Models(Class<?>... entityClasses)
Convert entity classes to editable TableModel instances |
static TableModel |
entity2ReadOnlyModel(Class<?> entityClass)
Convert entity class to a read-only TableModel instance |
static TableModel[] |
entity2ReadOnlyModels(Class<?>... entityClasses)
Convert entity classes to read-only TableModel instances |
static String |
model2JavaSrc(TableModel model,
boolean linkStyle,
boolean activeRecord,
String packageName)
Convert a TablemModel instance to Java entity class source code |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TableModelUtils()
| Method Detail |
|---|
public static TableModel entity2Model(Class<?> entityClass)
public static TableModel[] entity2Models(Class<?>... entityClasses)
public static TableModel entity2ReadOnlyModel(Class<?> entityClass)
public static TableModel[] entity2ReadOnlyModels(Class<?>... entityClasses)
public static TableModel[] db2Models(Connection con,
Dialect dialect)
public static void db2JavaSrcFiles(DataSource ds,
Dialect dialect,
boolean linkStyle,
boolean activeRecord,
String packageName,
String outputfolder)
ds - The DataSource instancedialect - The dialect of databaselinkStyle - if true, create linked style setter, otherwise create normal
setteractiveRecord - if true, build a jSqlBox ActiveRecord Entity class, otherwise
build a POJO classpackageName - Optional, the package name of this entity classoutputfolder - the out put folder
public static String model2JavaSrc(TableModel model,
boolean linkStyle,
boolean activeRecord,
String packageName)
model - The TableModel instancelinkStyle - if true, create linked style setter, otherwise create normal
setteractiveRecord - if true, build a jSqlBox ActiveRecord Entity class, otherwise
build a POJO classpackageName - Optional, the package name of this entity class
public static void bindGlobalModel(Class<?> entityClass,
TableModel tableModel)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||