21.Which method is used to re-read the state of the given instance from the underlying database?Session.refresh re-reads the state of the given instance from the underlying database. 22.Which method is used to save the state of the given instance from the underlying database?Session.save saves the state of the given instance from the underlying database. 23.Which method is used to update the state of the given instance from the underlying database?Session.update updates the state of the given instance from the underlying database. 24.Which method is used to save or update the state of the given instance from the underlying database?Session.saveOrUpdate either savesObject or updatesObject the given instance. 25.What are persistent classes in hibernate?Java classes whose objects or instances will be stored in database tables are called persistent
classes in Hibernate. 26.Where Object/relational mappings are defined in hibernate?An Object/relational mappings are usually defined in an XML document. This mapping file instructs
Hibernate how to map the defined class or classes to the database tables. We should save the
mapping document in a file with the format 27.What is root node of hbm.xml?The mapping document is an XML document having 28.Which element of hbm.xml defines a specific mappings from a Java classes to the database tables?The 29.Which element of hbm.xml defines maps the unique ID attribute in class to the primary key of the database table?The 30.Which element of hbm.xml is used to automatically generate the primary key values?The 31.Which element of hbm.xml is used to map a Java class property to a column in the database table?The 32.Which element of hbm.xml is used to map a java.util.Set property in hibernate?This is mapped with a 33.Which element of hbm.xml is used to map a java.util.SortedSet property in hibernate?This is mapped with a 34.Which element of hbm.xml is used to map a java.util.List property in hibernate?This is mapped with a 35.Which element of hbm.xml is used to map a java.util.Collection property in hibernate?This is mapped with a 36.Which element of hbm.xml is used to map a java.util.Map property in hibernate?This is mapped with a 37.Which element of hbm.xml is used to map a java.util.SortedMap property in hibernate?This is mapped with a 38.What is many-to-one association?A many-to-one association is the most common kind of association where an Object can be
associated with multiple objects. For example a same address object can be associated with
multiple employee objects.
39.What is one-to-one association?A one-to-one association is similar to many-to-one association with a difference that the column
will be set as unique. For example an address object can be associated with a single employee
object.
40.What is one-to-many association?In One-to-Many mapping association, an object can be can be associated with multiple objects. For
example Employee object relates to many Certificate objects.
A One-to-Many mapping can be implemented using a Set java collection that does not contain any
duplicate element.
|