Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong db reverse type generation in 3.3.0 #618

Closed
dmiorandi opened this issue Jan 7, 2014 · 6 comments
Closed

Wrong db reverse type generation in 3.3.0 #618

dmiorandi opened this issue Jan 7, 2014 · 6 comments
Milestone

Comments

@dmiorandi
Copy link

@dmiorandi dmiorandi commented Jan 7, 2014

Hi Timo,
generating on 3.3.0 my db classes there are wrong type mapping. I don't understanding what has happening but this is the code that generate this issue.
On class MetaDataExporter the part between ** brake columnSize. I.e. NUMBER (3,0)
became NUMBER(22,0) and is mapped to BigInteger.
:

private void handleColumn(EntityType classModel, String tableName, ResultSet columns) throws SQLException {
        String columnName = normalize(columns.getString("COLUMN_NAME"));
        String normalizedColumnName = namingStrategy.normalizeColumnName(columnName);
        int columnType = columns.getInt("DATA_TYPE");
        Number columnSize = (Number) columns.getObject("COLUMN_SIZE");
        Number columnDigits = (Number) columns.getObject("DECIMAL_DIGITS");
        Object charLength = columns.getObject("CHAR_OCTET_LENGTH");
        **if (charLength instanceof Number) {
            columnSize = (Number)charLength;
        }**
timowest added a commit that referenced this issue Jan 7, 2014
@timowest
Copy link
Member

@timowest timowest commented Jan 7, 2014

Fixed, now COLUMN_SIZE is always used:
column size. For char or date types this is the maximum number of characters, for numeric or decimal types this is precision.

@timowest
Copy link
Member

@timowest timowest commented Jan 7, 2014

Could you try again with the latest SNAPSHOT?

@dmiorandi
Copy link
Author

@dmiorandi dmiorandi commented Jan 7, 2014

Yes i will try it tomorrow
Il 07/gen/2014 19:53 "Timo Westkämper" notifications@github.com ha
scritto:

Could you try again with the latest SNAPSHOT?


Reply to this email directly or view it on GitHubhttps://github.com//issues/618#issuecomment-31766807
.

@dmiorandi
Copy link
Author

@dmiorandi dmiorandi commented Jan 9, 2014

ok Timo, It seems to work.

@dmiorandi dmiorandi closed this Jan 9, 2014
@timowest
Copy link
Member

@timowest timowest commented Jan 9, 2014

I'll close it when it's released

@timowest timowest reopened this Jan 9, 2014
@timowest
Copy link
Member

@timowest timowest commented Feb 8, 2014

Released in 3.3.1

@timowest timowest closed this Feb 8, 2014
@timowest timowest added this to the 3.3.1 milestone Apr 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants