Online Test

  • Facebook
  • Google
  • LinkedIn
  • Twitter
Question: 1
How will get a session object in hibernate?
SessionFactory.getSession();
SessionFactory.openSession();
SessionFactory.get();
SessionFactory.openObject();

Question: 2
Which core interface used in every Hibernate application, where you can store and retrieve persistent objects. ?
Configuration interface
Session interface
Query and Criteria interfaces
All of the above

Question: 3
How can a whole class be mapped as immutable?
By using the mutable="false" attribute in the class mapping
By using the ismutable="false" attribute in the class mapping
By using the mutable="true" attribute in the class mapping
None of the above

Question: 4
What is the database connection setting in the hibernate configuration file ?
<property name="connection.url">db_url</property>
<property name="database.url">db_url</property>
<property name="connection_url">db_url</property>
None of the above

Question: 5
Which is true about configuration component of Hibernate?
The Configuration object represents a configuration or properties file required by the Hibernate.
The Configuration object is usually created only once during application initialization.
The Configuration object is the first Hibernate object you create in any Hibernate application.
All of the above.

Question: 6
Which is the Hibernate XML configuration file name. ? 
hibernate.cfg.xml
hibernate.config.xml
hibernate.cg.xml
None of the above

Question: 7
Difference between Student d = session.load(Student.class) and Student d = session.createCriteria(Student.class)?
On session close session.load() Student object will unavailable to access
On session close session.createCriteria() Student will unavailable to access
On session close session.load() Student object will available to access
None of the above

Question: 8
Which property is used to enable auto commit for JDBC pooled connections?
hibernate.hbm2ddl.auto
hibernate.connection.autocommit
hibernate.hbm2ddl_auto
hibernate.connection_autocommit

Question: 9
Is it correct configuration?

<class name="com.javatutsworld.bean.Student" table="STUDENT">
Correct
Not Correct
Exception will come
None of the above

Question: 10
Which is the correct method to used for update the state of the given instance from the database?
Session.keep()
Session.store()
Session.update()
Session.load()

      Advertisements