Wrong db reverse type generation in 3.3.0 #618

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

Comments

Projects
None yet
2 participants
@dmiorandi

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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jan 7, 2014

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jan 7, 2014

Member

Could you try again with the latest SNAPSHOT?

Member

timowest commented Jan 7, 2014

Could you try again with the latest SNAPSHOT?

@dmiorandi

This comment has been minimized.

Show comment
Hide comment
@dmiorandi

dmiorandi 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/mysema/querydsl/issues/618#issuecomment-31766807
.

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/mysema/querydsl/issues/618#issuecomment-31766807
.

@dmiorandi

This comment has been minimized.

Show comment
Hide comment
@dmiorandi

dmiorandi Jan 9, 2014

ok Timo, It seems to work.

ok Timo, It seems to work.

@dmiorandi dmiorandi closed this Jan 9, 2014

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jan 9, 2014

Member

I'll close it when it's released

Member

timowest commented Jan 9, 2014

I'll close it when it's released

@timowest timowest reopened this Jan 9, 2014

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Feb 8, 2014

Member

Released in 3.3.1

Member

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