Tag: web technology

Questions Related to web technology

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

  1. all

  2. persist

  3. delete

  4. All the above


Correct Option: D

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
  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 is the function call ensure that SQL statement is executed?

  1. commit()

  2. flush()

  3. close()

  4. list()


Correct Option: B

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
  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 not a basic value type in hibernate?

  1. integer

  2. character

  3. yes_no

  4. None of the above


Correct Option: D

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
  1. Using several dialect

  2. Using several

  3. Using several connection properties

  4. Not possible to map more than one database


Correct Option: B