
What is the generator in hibernate?

Hi Friends,
Hibernate Generator is used for primary key generation. It generate primary key when new record inserted.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping auto-import="true" default-lazy="true"> <class name="net.roseindia.model.EmployeeInfoModel" table="employeeinfo"> <id name="id" column="id" type="java.lang.Integer"> <generator class="increment" /> </id> <property name="name" column="name" type="java.lang.String" /> <property name="address" column="address" type="java.lang.String" /> </class> </hibernate-mapping>
Thanks.......
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.