Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html
I want help for generating the Unique key constraint using .hbm.xml
<property name="name" type="java.lang.String" >
<column name="name" sql-type="mediumtext"
not-null="true" index="products_name_idx" />
</property>
<many-to-one name="products"
class="dao.entity.Products"
cascade="none" not-null="true" column="product_id"
unique-key="products_name_idx" />
Actually combinations name and product_id is unique.How to generate this using .hbm.xml, so that it will geneate corresponding index name in the mysql data base.
Next,
I used the index attribute in the property tag. but it is not generating the index corresponding index name in the data base. Is there any solution for this.
If any one know about this pls, reply.