0

web technology Online Quiz - 195

Description: web technology Online Quiz - 195
Number of Questions: 20
Created by:
Tags: web technology
Attempted 0/20 Correct 0 Score 0

What is the root element in hibernate.cfg.xml?

  1. None of the above


Correct Option: A

Which of the following is true?

  1. Every table must have a separate mapping file

  2. Only parent table needs separate mapping fie

  3. Only child table need separate mapping file

  4. One mapping file can have mappings for one or more table.


Correct Option: D

How to get SessoionFactory from configuration object (config) ?

  1. config.createSessionFactory()

  2. config.getSessionFactory()

  3. config.buildSessionFactory()

  4. config. SessionFactory.newInstance()


Correct Option: C

Which of the following association needs tag element in mapping file?

  1. One to one

  2. One to many

  3. Many to one

  4. None of the above


Correct Option: B

Which is not a basic value type in hibernate?

  1. integer

  2. character

  3. yes_no

  4. None of the above


Correct Option: D

If you intend to put instances of persistent classes in a Set, you have to

  1. Override equals() method

  2. Override hashCode() method

  3. Both a and b

  4. Neither a nor b


Correct Option: C

Which is the function call ensure that SQL statement is executed?

  1. commit()

  2. flush()

  3. close()

  4. list()


Correct Option: B

What is property name for printing all the executed SQL statements?

  1. echo_sql

  2. show_sql

  3. print_sql

  4. display_sql


Correct Option: B

Which of the following must be satisfied by a component class?

  1. Implements java.io.Serializable

  2. Override equals() method

  3. Override hashCode() method

  4. Both a, b and c


Correct Option: D

How to add ordering phrase in hibernate criteria?

  1. criteria.setOrder( Order.asc("name") )

  2. criteria.add( Order.asc("name") )

  3. criteria.addOrder( Order.asc("name") )

  4. criteria.addOrder( "name asc" )


Correct Option: C

What should be done to change the actual database system type (say, from DB2 to MySql)?

  1. connection.driver_class property should be changed

  2. connection.url property should be changed

  3. dialect property should be changed

  4. All the above


Correct Option: D

How can we map several databases in hibernate?

  1. Using several dialect

  2. Using several

  3. Using several connection properties

  4. Not possible to map more than one database


Correct Option: B

What kind of query standards can be used in hibernate?

  1. Native SQL

  2. HSQL

  3. Both

  4. None of the above


Correct Option: C

Which one of the following will commit session?

  1. session..commit()

  2. session.getCommitTransaction()

  3. session.getTransaction().commit()

  4. session.getTransaction().save()


Correct Option: C

What are the different states of persistent classes?

  1. Transient, persistent, destroyed

  2. Transient, stored, detached

  3. Transient, persistent, detached

  4. open, close, detached


Correct Option: C

What is the way to pass configuration properties to Hibernate?

  1. Pass an instance of java.util.Properties to Configuration.setProperties().

  2. Place hibernate.properties in a root directory of the classpath.

  3. Set System properties using java -Dproperty=value.

  4. All the above


Correct Option: D

Which is true in the following statements?

  1. Hibernate does not support lazy initialization for detached objects.

  2. Access to a lazy association outside of the context of an open Hibernate session will result in an exception.

  3. Lazy fetching is way to avoid unnecessary column reads.

  4. All the above.


Correct Option: D

Which statement is executing native query to fetch records from table?

  1. sess.createQuery("SELECT * FROM CATS").list();

  2. sess.createSQLQuery("FROM CATS").list();

  3. sess.createSQLQuery("SELECT * FROM CATS").list();

  4. sess.createSQLQuery("from CATS", com.animals.Cat.class).list();


Correct Option: C

Which are the valid values for Cascade attribute in mapping xml?

  1. all

  2. persist

  3. delete

  4. All the above


Correct Option: D

Bi-directional links between data models are possible in Hibernate?

  1. True

  2. False


Correct Option: A
- Hide questions