- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 26
Guide Step 2 DB Model
This step describe how to create a new model from an existing database.
Before continuing ensure your home directory is defined and the project has been initialized.
Edit the  databases.dbcfg XML file to define a new database configuration.
Launch the external editor with the edb (Edit DB) command in Telosys-CLI or if you are in your prefered editor (Atom, VSCode, etc) just open the databases.dbcfg file.
In databases.dbcfg add a new <db> tag with all the expected information (use the examples of databases configuration available in the commented lines of the file).
For each database you must define the following attributes :
- 
idan integer that identifies the database (from 0 to N)
- 
namethe database name (just for information, you can use any name)
- 
driverthe JDBC driver class name
- 
urlthe JDBC URL to access the database
If you plan to generate code for JPA also define :
- 
typeNamethe type of database (eg "POSTGRESQL", "DERBY", "H2", "ORACLE", etc)
- 
dialectthe JPA dialect (eg "org.hibernate.dialect.MySQLDialect")
Set the following JDBC properties ( in a <property> tag ) :
- property name userthe database user
- property name passwordthe database user's password
- if necessary any other JDBC specific properties required by your database
Define the following information used to retrieve the JDBC METADATA ( in the <metadata> tag ):
- 
catalogthe database catalog to be used if any ("" for void, "!" for null)
- 
schemathe database schema containing the tables you want to use ("" for void, "!" for null)
- 
table-name-patternthe pattern to filter the tables names (eg "%" for all tables )
- 
table-typesthe type of tables to be used (eg "TABLE VIEW", "TABLE", "VIEW")
- 
table-name-excludea pattern to exclude some tables
- 
table-name-includea pattern to include some tables
- Installation
- Configuration
- Commands
- User guide :
- Project initialization
- Model initialization :
- Templates
- Code generation