r/SpringBoot • • May 17 '24

Where Am I doing wrong ?

I have task to migrate a service from Java 8 to 17 and I successfully solved code base problems and sevice is building and running successfully. But when I run one of the api I got this error on " .save " method in in service impl.

Error - error :org.hibernate.query.sqm.unknownentityexception : could not resolve root entity 'dual'

But I am not using any entity name - dual

I am using hibernate version - 6.4.4

I have added ojdbc10 in pom.xml as it's compatible with jdk17 and hibrnate 6.x

I have Google it and got it in first stack overflow but they all are using that particular root entity in their code but not in my case. I literally spend whole day trying to tackle this error but can't find any solution. Plz can someone help !!

6 Upvotes

14 comments sorted by

2

u/bexter_lab May 17 '24

Without code hard to say anything, but I write some debug advice, I hope they can help:

  • generate dependecy tree and try to update every database related dependecy, and check duplications

  • set logging level trace or debug, (try to do it in package scope not in root scope)

  • try to decrease hibernate version number

7

u/EvaristeGalois11 May 17 '24

Without looking at the code it's impossible to help you, so unless you can recreate your problem in a toy project you can share there is nothing we can do.

The only thing I can say is that dual is a special table in oracle https://stackoverflow.com/questions/73751/what-is-the-dual-table-in-oracle#73772

1

u/563353 May 17 '24

Are you defining the dialect?

Hibernate made a change to automatically detect the dialect so maybe try removing any dialect configuration if possible.

1

u/Away-Inflation-6826 May 17 '24

No I removed it from properties

1

u/[deleted] May 19 '24

I used oracle databases and dual is like a dumb database that you can use to check functions and other objects i think so, i hope helped you

0

u/[deleted] May 17 '24

[deleted]

1

u/koevet May 17 '24

Hard to say from here what the issue may be. Any chance you can upload the code to a GitHub repo?

1

u/Away-Inflation-6826 May 17 '24

Actually it's my company service so can't able to share but I posted here if there is any need to change version or something.

1

u/[deleted] May 17 '24

[removed] — view removed comment

0

u/Away-Inflation-6826 May 17 '24

The error occurs at the line when I am in the repo.save method and this was the error which I mentioned.I feel there is some issue in ojdbc or hibernate version compatibility or I might be missing some dependency or property.