I wonder if anybody can help.
I have a class structure that I am working on and I would like to generate the sql tables and mapping files from these classes. Is it possible?
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.
Yes, you can.
You need:
hibernate.cfg.xml with this line
create
More info here: Hibernate hbm2ddl.auto possible values and what they do?
and here: http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/session-configuration.html
you need to map the class: there are 2 ways:
with annotation or hbm files. Here some about mapping: http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/mapping.html
.
In the mapping you need to describe name table, catalog and (if you want) column.