When I have create-drop set as hbm2ddl I want the app to also insert some default data.
Is it possible to somehow write some extension to JPA or Hibernate that can do it?
default data = 10 inserts! with a very simple data!
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.
During
createorcreate-dropHibernate by default executes SQL statements from the file namedimport.sqlin the classpath (if exists), so you can place your SQL script there.Since Hibernate 3.6 you can also specify other files with
hibernate.hbm2ddl.import_filesproperty.See also:
Environment.HBM2DDL_IMPORT_FILES