A Jailer Data Model file is stored in an extended CSV file format ('Comma Separated Values')
  • the separating character is ';'
  • empty lines are ignored
  • Lines starting with '#' are comments and will be ignored


Table-File (datamodel/table.csv)  

For each table the following information is required:
  • Name
  • Upsert/Insert
                 N: generate INSERT-statements for entities of this table
                 Y: generate 'INSERT IF NOT EXISTS' + UPDATE-statements
                     (can be overridden in an extraction model)
  • Primary-Keys, primary key columns in SQL syntax
  • Empty, indicates end of primary key column list.
  • Author, optional

Example:

Name upsert primary key colum 1 primary key column 2 primary key column 2 ... Empty Author
DEPARTMENT Y
DEPTNO INTEGER IBM DB2 JDBC Driver
EMPLOYEE N EMPNO INTEGER IBM DB2 JDBC Driver
SALARYGRADE Y
GRADE INTEGER LOSAL INTEGER HISAL INTEGER IBM DB2 JDBC Driver

Column-File (datamodel/column.csv)  

Contains column info for each table.
  • Name, Table name
  • Columns, all columns in SQL syntax (suffix 'null' if the column is nullable)
  • Empty, indicates end of primary key column list.
  • Author, optional

Example:

Name Colum 1 Column 2 Column 2 ... Empty Author
DEPARTMENT DEPTNO INTEGER NAME VARCHAR(14) null LOCATION VARCHAR(13) null IBM DB2 JDBC Driver
EMPLOYEE EMPNO INTEGER NAME VARCHAR(10) null  JOB VARCHAR(9) null IBM DB2 JDBC Driver
SALARYGRADE GRADE INTEGER LOSAL INTEGER HISAL INTEGER IBM DB2 JDBC Driver

Associations-File (datamodel/association.csv)  

For each table the following information is required:
  • Table A source table
  • Table B destination table
  • first-insert specifies dependency:
                      - A, if B depends on A
                      - B, if A depends on B
                      - nothing if the association is not a dependency
  • Cardinality of the association. 1:1, 1:n, n:1, n:m or empty (=unknown cardinality)
  • Join-Condition of the association. Use the table-aliases A und B.
  • Name. Unique name of the association.
  • Author
Example:

Table A Table B first-insert Cardinality
Join-Condition Name Author
DEPARTMENT EMPLOYEE A
1:n
A.DEPTNO=B.DEPTNO DEPARTMENT
JDBC Driver
EMPLOYEE EMPLOYEE A 1:n
A.EMPNO=B.BOSS SUBORDINATE JDBC Driver
EMPLOYEE SALARYGRADE
n:1
A.SALARY BETWEEN B.LOSAL AND B.HISAL SALARY
Wisser