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

Issue with creating the user table name #1

Open
anshupal opened this issue Jun 27, 2022 · 2 comments
Open

Issue with creating the user table name #1

anshupal opened this issue Jun 27, 2022 · 2 comments
Assignees

Comments

@anshupal
Copy link

Hi-
Hibernate ran into an issue while trying to create the User table. It gave an error message that indicated that User was a reerved word. So following hibernate convention I backticked the table name User and then it worked. I was wondering if anybody else had the same issue ?

@mechero mechero self-assigned this Jun 28, 2022
@mechero
Copy link
Contributor

mechero commented Jun 28, 2022

Hi @anshupal! Yes, that's a good finding, I also faced this myself last week while preparing the update to Spring Boot 2.7. H2 database had a major upgrade and now that doesn't work because it's indeed a reserved word. More people will find this same issue when using SB 2.7 version, so thanks for sharing it! I'll also share an alternative workaround I found in the docs.

@david-randoll
Copy link

david-randoll commented Dec 8, 2022

I annotate my User class with @Table(name = "users") and it worked. As you said because of the reserved keyword.

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

3 participants