i am new to spring mvc and hibernate. in aspnet MVC when we make model and set attribute its migrate to SQL and create table with our class and alter tables. is there anything like this in hibernate and spring MVC?
Asked
Active
Viewed 116 times
1
-
Hibernate does this by default. Did you try? – BackSlash Sep 25 '18 at 13:07
-
Please see https://stackoverflow.com/questions/438146/hibernate-hbm2ddl-auto-possible-values-and-what-they-do – Sep 25 '18 at 13:10
-
@BackSlash in lynda videos i've seen he first make table with sql in script to my sql and then make model... thats why i am asking this in aspnet mvc after adding migration it will alter database after changes – mohammad khalifeh Sep 25 '18 at 13:15
-
you can use spring-boot that does the same thing. you need to define Entity class with column attribute and it will create table. – Shahid Sep 25 '18 at 13:22
-
@Shahid after create entity class and models . after run it will automaticaly create tables and handle relations? – mohammad khalifeh Sep 25 '18 at 13:26
-
@Shahid im using spring mvc – mohammad khalifeh Sep 25 '18 at 13:27
-
Yes, it handles everything. https://spring.io/guides/gs/accessing-data-jpa/ – Shahid Sep 25 '18 at 13:28
-
Not sure about spring-mvc but spring-boot gives you this feature. – Shahid Sep 25 '18 at 13:29
-
thank you for assistance – mohammad khalifeh Sep 25 '18 at 13:36