pass your queries to?
i am useing hibernate,,,i used @PersistenceContext
and yes...waith
There's a setting somewhere suitable only for early development phase. For some reason it is default. Search for "auto-update" or something like that in hibernate configuration. For spring that is in "application.properties/yml"
That setting is exactly for this beahvior - on each app start it recreates schema based on your java code (entities classes).
If Iremember it correctly, this behavior goes with "drop-create", you can grep for it
I changed it to update or create and stil there is no tables...and i am using persistense.xml to connect to server
You've mentioned that the tables are not created in your drive. You've also mentioned that hibernate says that the tables are created. How does hibernate confirm that.. I mean, do you do a custom check if table exist (or) are you referring to the standard confirmation from the hibernate inbuilt methods (like persist())?
I dont know why hibernate confrim it but it happend😂
It cannot persist if the table is not there; I guess you're talking about data missing & not the tables missing. Confirm on that. If you're talking about tables itself missing, then do a manual check to check if the table exists during runtime. This way, you can confirm that the tables are getting created but are also getting deleted at the end of script, somehow.
This! And check whether you can select a table after restarting the Program.
In persistence.xml it is done a little bit different way. I'm acutally not sure which takes precedenc, spring's application.properties or hibenate's persistence. I'm pretty sure you're facing issues because of exactly this hibernate's "feature". Your screenshot clearly proves that. And it's not about db configuration, priviledges, or anything like that. That's all hibernate. Here's the first google result: https://stackoverflow.com/questions/306806/hibernate-automatically-creating-updating-the-db-tables-based-on-entity-classes
Обсуждают сегодня