| 1600 PMP mock questions | 1400 CAPM mock questions | 800 SCJP 6 mock questions | 600 OCAJP 7 mock questions | 590 OCPJP 7 mock questions | 556 SCWCD 5 mock questions | 500 OCEJWCD 6 mock questions | pdfDownload (java,struts, hibernet etc) | JobsJobs and Walkins |
|
Java online test
JSP online test ORACLE online test Hibernate online test Servlet online test Struts online test EJB online test C online test C++ online test Aptitude online test |
Q.What are the general considerations or best practices for defining your Hibernate persistent classes?
|
|
|
1.You must have a default no-argument constructor for your persistent classes and there should be getXXX() (i.e accessor/getter) and setXXX( i.e. mutator/setter) methods for all your persistable instance variables.
2.You should 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 (i.e. Hibernate managed identifier). This is because the Hibernate only generates and sets the field when saving the object. 3. It is recommended to implement the Serializable interface. This is potentially useful if you want to migrate around a multi-processor cluster. 4.The persistent class should not be final because if it is final then lazy loading cannot be used by creating proxy objects. |
Suggested JobsMore Jobs >> |
|
Online Practice TestJava online testJSP online test ORACLE online test Hibernate online test Servlet online test Struts online test EJB online test C online test C++ online test Aptitude online test |