Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

What are the general considerations or best practices for defining your Hibernate persistent classes?
The general considerations or best practices for defining your Hibernate persistent classes are:
  * You must have defined no-argument constructor, getters and setters method.
  * Implement the equals() and hashCode() methods based on your business key and it is important not to use the id field in your equals() and hashCode() definition if the id field is a surrogate key.
  * Implement the Serializable interface.
  * The persistent class should not be final.
  * Use XDoclet tags for generating your *.hbm.xml files or Annotations.