Documente Academic
Documente Profesional
Documente Cultură
(choose 4)
a) select
b) join
c) update
d) batch
e) lazy collection
2. The proxy attribute in Hibernate enables lazy initialization of persistent instances of the class. (choose 1)
a) True
b) False
a) By setting mutable="true"
b) By setting mutable="false"
c) By setting immutable="false"
d) By setting immutable="true"
5. Which of the following are some main interfaces provided by Hibernate? (choose 3)
a) org.hibernate.HibernateSession
b) org.hibernate.Session
c) org.hibernate.SessionFactory
d) org.hibernate.Criteria
6. Which of the following ways can be used to represent joins in Hibernate? (choose 4)
8. How can you make sure a property you read from a database table is not modified in anyway? (choose 1)
9. The attribute dynamic-insert in a class mapping specifies that insert sql should be generated at runtime
and contain only the columns whose values are not null. (choose 1)
a) True
b) False
10. When you place both hibernate.properties and hibernate.cfg.xml in the classpath, the settings of
hibernate.properties will override hibernate.cfg.xml. (choose 1)
a) True
b) False
a) This class provides different methods for querying/retrieving data from the database.
a) True
b) False
13. Which of the following is true about session.update() method and session.lock() method? (choose 2)
a) The session.lock() method simply reattaches the detached object to the session without checking or
updating the database.
b) The session.lock() method checks the database to make sure it is in sync and then reattaches the
detached object to the session.
c) The session.update() method checks the database to make sure it is in sync and then reattaches the
detached object to the session.
d) The session.update() method simply reattaches the detached object to the session without checking
or updating the database.
a) True
b) False
15. Which of the following ways can be used for configuring hibernate? (choose 2)
a) EJB 4.0
b) EJB 2.0
c) EJB 3.0
18. The inverse option in a one-to-many mapping indicates which end of the relationship should be used?
(choose 1)
a) True
b) False
a) ORM technique allows you to view the underlying data/database tables as object based.
20. Which of the following are true about detached objects? (choose 1)
a) Detached objects can be detached from a session and later can only be re-attached to the same
session.
b) Detached objects can be detached from a session and later re-attached to a differnet session.
21. Which of the following is true about session.get() method and session.load() method? (choose 2)
a) If object being loaded/retrieved from database does not exist, session.get() returns null.
b) If object being loaded/retrieved from database does not exist, session.get() throws an exception.
c) If object being loaded/retrieved from database does not exist, session.load() returns null.
d) If object being loaded/retrieved from database does not exist, session.load() throws an exception.
22. You are currently using MySql database and you are required to switch to Oracle database. How do you
accomplish this in Hibernate without making any code changes and keeping the changes minimal? (choose 1)
23. How do you configure Hibernate to access an instance variable directly instead of via a setter method?
(choose 1)
24. Which of the following can be used to log all sql statements in the console? (choose 1)
25. Which of the following collection types are supported by Hibernate? (choose 4)
a) Set
b) List
c) Bag
d) Basket
e) Map
Sat Nov 15
Start time: 21:22:05 CST
2008
Sat Nov 15
End time: 21:35:38 CST
2008
13 minutes 33
Duration:
seconds
a) ORM technique allows you to view the underlying data/database tables as object based.
22. Which of the following are true about detached objects? (choose 1)
a) Detached objects can be detached from a session and later can only be re-attached to the same
session.
b) Detached objects can be detached from a session and later re-attached to a differnet session.
23. Which of the following is true about session.update() method and session.lock() method? (choose 2)
a) The session.lock() method simply reattaches the detached object to the session without checking or
updating the database.
b) The session.lock() method checks the database to make sure it is in sync and then reattaches the
detached object to the session.
c) The session.update() method checks the database to make sure it is in sync and then reattaches the
detached object to the session.
d) The session.update() method simply reattaches the detached object to the session without checking
or updating the database.
24. Which of the following can be used to log all sql statements in the console? (choose 1)
25. Which of the following are true about derived properties? (choose 1)
16. The attribute dynamic-insert in a class mapping specifies that insert sql should be generated at runtime
and contain only the columns whose values are not null. (choose 1)
a) True
b) False
17. Which of the following ways can be used to represent joins in Hibernate? (choose 4)
18. Which of the following collection types are supported by Hibernate? (choose 4)
a) Set
b) List
c) Bag
d) Basket
e) Map
19. Which of the following is true about Hibernate's Session object? (choose 2)
20. You are currently using MySql database and you are required to switch to Oracle database. How do you
accomplish this in Hibernate without making any code changes and keeping the changes minimal? (choose 1)
a) EJB 4.0
b) EJB 2.0
c) EJB 3.0
d) None of the above
a) This class provides different methods for querying/retrieving data from the database.
14. Which of the following ways can be used for configuring hibernate? (choose 2)
15. When you place both hibernate.properties and hibernate.cfg.xml in the classpath, the settings of
hibernate.properties will override hibernate.cfg.xml. (choose 1)
a) True
b) False
a) select
b) join
c) update
d) batch
e) lazy collection
7. The proxy attribute in Hibernate enables lazy initialization of persistent instances of the class. (choose 1)
a) True
b) False
8. How can you make sure a property you read from a database table is not modified in anyway? (choose 1)
9. The inverse option in a one-to-many mapping indicates which end of the relationship should be used?
(choose 1)
a) True
b) False
a) True
b) False
a) True
b) False
2. Which of the following are some main interfaces provided by Hibernate? (choose 3)
a) org.hibernate.HibernateSession
b) org.hibernate.Session
c) org.hibernate.SessionFactory
d) org.hibernate.Criteria
a) By setting mutable="true"
b) By setting mutable="false"
c) By setting immutable="false"
d) By setting immutable="true"
4. How do you configure Hibernate to access an instance variable directly instead of via a setter method?
(choose 1)
5. Which of the following is true about session.get() method and session.load() method? (choose 2)
a) If object being loaded/retrieved from database does not exist, session.get() returns null.
b) If object being loaded/retrieved from database does not exist, session.get() throws an exception.
c) If object being loaded/retrieved from database does not exist, session.load() returns null.
d) If object being loaded/retrieved from database does not exist, session.load() throws an exception.