Data modeling after the creation of the corresponding database, in the development of programming often encounter a very troublesome thing, that is to write the table as the corresponding entity class, for the developer of a field of a field of the comparison, copy, paste ... This is a very crazy thing, and now specifically the corresponding script, has been tested in Oracle. The script is as follows:
Select 'Private' ||DECODE (T.data_type,'VARCHAR2', 'String', 'CHAR', 'String', 'DATE', 'Date', ' Number', 'int', 'LONG', 'Long', 'FLOAT', 'Float')|| Lower(T.column_name)||'; //'||c.comments fromUser_tab_cols t,user_col_comments CwhereT.table_name='TABLENAME' andC.table_name=T.table_name andC.column_name=T.column_nameORDER byt.column_id;
Where TABLENAME is the corresponding table name. The effect is as shown in figure:
Next, the full column selects replication, then pastes it in the corresponding entity class, and then uses the Quick Generate Code tool in the development platform. An entity class seconds seconds to fix!!!
Use SQL script to generate entity class properties for a table field VO