Search your topic in Java2share
Home > FAQs
eXTReMe Tracker

Hibernate FAQs

49.How can Hibernate be configured to access an instance variable directly and not through a setter method ?
By mapping the property with access="field" in Hibernate metadata. This forces hibernate to bypass the setter method and access the instance variable directly while initializing a newly loaded object.

50.How can a whole class be mapped as immutable?
Mark the class as mutable="false" (Default is true),. This specifies that instances of the class are (not) mutable. Immutable classes, may not be updated or deleted by the application.

51 .  Explain about transparent persistence of Hibernate?
Transparent persistence is provided for Plain old Java objects or POJOs. For proper functioning of the applications importance should be given to the methods equals () and hash Code methods (). It has a requirement which should be strictly followed in the applications which is a no-argument constructor.

52 .  Explain about the dirty checking feature of Hibernate?
Dirty checking feature of the Hibernate allows users or developers to avoid time consuming data base write actions. This feature makes necessary updations and changes to the fields which require a change, remaining fields are left unchanged or untouched.

53 .  What is the effect when a transient mapped object is passed onto a Sessions save?
When a Sessions save () is passed to a transient mapped object it makes the method to become more persistent. Garbage collection and termination of the Java virtual machine stays as long as it is deleted explicitly. It may head back to its transient state.

54 .  Explain about addClass function?
This function translates a Java class name into file name. This translated file name is then loaded as an input stream from the Java class loader. This addClass function is important if you want efficient usage of classes in your code.