Skip to content

Conversation

Bo98
Copy link
Collaborator

@Bo98 Bo98 commented Dec 17, 2018

Statement.RETURN_GENERATED_KEYS is a poorly defined standard. Different JDBC drivers interpret it differently so its behaviour can, and does, differ.

The best example of this is PostgreSQL and modern H2 drivers where this flag will still return rows which have a column generated, but the result set contains all columns. Meanwhile over in SQL Server, it returns a pseudocolumn and not a real column so even filtering the result set will not work there.

So instead we explicitly declare which column we want which works a lot better for compatibility between drivers.

On the JDBC side: j256/ormlite-jdbc#39.

@j256
Copy link
Owner

j256 commented Jan 1, 2019

Good stuff!! Again awesome tests dude. Thanks much.

@j256 j256 merged commit 2c15933 into j256:master Jan 1, 2019
@Bo98 Bo98 deleted the generated-keys-by-column-name branch January 2, 2019 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants