What is the difference between SchemaUpdate and SchemaExport in Hibernate.
What is the difference between SchemaUpdate and SchemaExport in Hibernate. SchemaUpdate SchemaExport
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
SchemaExport (aka hbm2ddl) is tool that generates database schema (whole, not partial) from Hibernate mappings. SchemaExport needs to aware of dialect, but it does not consult existing database. Generated DDL statements can then be executed and/or saved to file and/or printer to standard out.
SchemaUpdate updates existing schema. To some extent it figures out which DDL statement should be executed to make existing database match to modified Hibernate mappings.
Good source for more detailed information is Hibernate Core Reference Manual – Chapter 22. Toolset Guide.