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

java.lang.IllegalArgumentException when running sample code with MYSQL #55

Closed
CC-Damo opened this issue Apr 24, 2021 · 4 comments
Closed

Comments

@CC-Damo
Copy link

CC-Damo commented Apr 24, 2021

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.

@ccleve
Copy link
Member

ccleve commented Apr 24, 2021 via email

@ccleve
Copy link
Member

ccleve commented Apr 24, 2021 via email

@CC-Damo
Copy link
Author

CC-Damo commented Apr 24, 2021

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:

@Id @GeneratedValue public BigInteger id;

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

@ccleve
Copy link
Member

ccleve commented Nov 18, 2022

Fixed by #79

@ccleve ccleve closed this as completed Nov 18, 2022
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

No branches or pull requests

2 participants