Exception Could not instantiate id generator [entity-name=Your DomainObject] Solution <generator> or @GeneratedValue specifies the Java class that is used to generate a unique identifier to the mapped persistent class. Using increment hbm.xml example <id name="id" type="java.lang.Long" column="id"> <generator class="increment" /> </id> Annotation example @Id @GeneratedValue(strategy=GenerationType.AUTO) @Column(name="ID") private Long id; Using database sequence hbm.xml example <id name="id" type="java.lang.Long" column="id"> <generator class="sequence"> <param name="sequence">SEQ_PERSON_ID</param> </generator> </id> Annotation example @Id @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="PERSON_SEQ") @SequenceGenerator(name="PERSON_SEQ&qu
Blog about programming