-
Notifications
You must be signed in to change notification settings - Fork 35
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
java.lang.IllegalArgumentException when running sample code with MYSQL #55
Comments
It's a mysql jdbc bug pertaining to generated keys. There is a workaround.
I'm at a ballgame right now, but I'll find it when I get back.
…On Sat, Apr 24, 2021, 5:21 PM Damien ***@***.***> wrote:
MYSQL Server Version: 8.0.23
mysql-connector-java Version: 8.0.23
When attempting to run the Sample code located here:
https://github.com/dieselpoint/norm/blob/master/src/test/java/com/dieselpoint/norm/SampleCode.java
The below Exception is thrown:
java.lang.IllegalArgumentException: Can not set long field
org.example.SampleCode$Name.id to java.math.BigInteger
Please can you advise if this is a known issue or if there is a known fix
as the same problem is also occurring in my own code when using this
library.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#55>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAITHKQFR23L7K5MVJ6XRLTTKM77TANCNFSM43QSN26Q>
.
|
https://bugs.mysql.com/bug.php?id=101823
I don't recall now if there is a workaround. You could make your primary
key a BigInteger.
On Sat, Apr 24, 2021, 5:31 PM Chris Cleveland ***@***.***>
wrote:
… It's a mysql jdbc bug pertaining to generated keys. There is a workaround.
I'm at a ballgame right now, but I'll find it when I get back.
On Sat, Apr 24, 2021, 5:21 PM Damien ***@***.***> wrote:
> MYSQL Server Version: 8.0.23
> mysql-connector-java Version: 8.0.23
>
> When attempting to run the Sample code located here:
> https://github.com/dieselpoint/norm/blob/master/src/test/java/com/dieselpoint/norm/SampleCode.java
>
> The below Exception is thrown:
> java.lang.IllegalArgumentException: Can not set long field
> org.example.SampleCode$Name.id to java.math.BigInteger
>
> Please can you advise if this is a known issue or if there is a known fix
> as the same problem is also occurring in my own code when using this
> library.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#55>, or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAITHKQFR23L7K5MVJ6XRLTTKM77TANCNFSM43QSN26Q>
> .
>
|
Hi CCleve, I hope you enjoyed your ball game! I did attempt to make my PK a big int before opening this bug with the below snippet:
However, a SQLSyntaxErrorException is thrown due to Incorrect column specifier for column 'id'. I have found however that an upsert does appear to work without error, I'm yet to see if this will function for my use case however. Thanks |
Fixed by #79 |
MYSQL Server Version: 8.0.23
mysql-connector-java Version: 8.0.23
When attempting to run the Sample code located here: https://github.com/dieselpoint/norm/blob/master/src/test/java/com/dieselpoint/norm/SampleCode.java
The below Exception is thrown:
java.lang.IllegalArgumentException: Can not set long field org.example.SampleCode$Name.id to java.math.BigInteger
Please can you advise if this is a known issue or if there is a known fix as the same problem is also occurring in my own code when using this library.
The text was updated successfully, but these errors were encountered: