empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jan (JIRA)" <empire-db-...@incubator.apache.org>
Subject [jira] [Resolved] (EMPIREDB-252) Add Support for database specific CodeGenParser
Date Fri, 02 Dec 2016 10:22:58 GMT

     [ https://issues.apache.org/jira/browse/EMPIREDB-252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

jan resolved EMPIREDB-252.
--------------------------
    Resolution: Fixed

I added the protected method getColumnSize in CodeGenParser which behaves like the implementation
before (returning just the size from the JDBC Meta result).

I added CodeGenParserMySQL, overriding this method and defining the size of the column by
checking the real types. Unfortunately there is no support for MEDIUMINT, so these will result
in INTEGER with size 4.

To use it, the user has to instantiate CodeGenParserMySQL in the generate method of CodeGenerator.

Added in commit 1ff38e379c12f7fc103439eb76dc5c3d2bb683e7

> Add Support for database specific CodeGenParser
> -----------------------------------------------
>
>                 Key: EMPIREDB-252
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-252
>             Project: Empire-DB
>          Issue Type: Improvement
>          Components: CodeGenerator
>    Affects Versions: empire-db-2.4.5
>            Reporter: jan
>            Assignee: jan
>            Priority: Minor
>             Fix For: empire-db-2.4.6
>
>
> When using the default CodeGenParser with a MySQL database you will get
> C1 = addColumn("C1", DataType.INTEGER, 10.0, true, null);
> for a column defined in the database as
> +-----------------------------+---------------------+------+-----+------------+-------+
> | Field                       | Type                | Null | Key | Default    | Extra
|
> +-----------------------------+---------------------+------+-----+------------+-------+
> | C1                          | int(10)             | NO   | PRI | NULL       |     
 |
> +-----------------------------+---------------------+------+-----+------------+-------+
> "(10)" is just an indicator for the column display width.
> If you defined a TINYINT(2) (1 byte), it will result in an SMALLINT (2 bytes).
> It should be possible to make database specific "calculations" of the column size.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message