-1

so im quite new to all spring and hibernate so i used a feature in myeclipse called generate CRUD application (it uses spring and hibernate for the heart of the application and JSF for presentation objects)that im intended to make changes so that i can work with .. my question is the following .. after i made the application that works fine by the way , i discovered that there are fields and probably even tables to be added to the database(an oracle 11g instance database)..so my questions are the following:

if i create the classes and update the existing .. will it be written directly in the database? if not is there any way to do it because i dont think a direct update in the database will be a good idea .. thank you in advance ..

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555

1 Answers1

0

If I understand correctly, you want to know whether the database schema can be created/updated automatically from your @Entity classes, and how to enable/disable such creation. Yes, it's possible by using some property. The name of the property would depend on your project kind. For example, in a default Spring Boot application, you can have

spring.jpa.hibernate.ddl-auto: update

in application.properties. The value update above will have the schema automatically created on first run and then updated on subsequently. validate instead of update won't alter the schema, but just validate it.

This stackoverflow post lists the possible values and their behaviour.

Community
  • 1
  • 1
Sanjay
  • 8,755
  • 7
  • 46
  • 62