Hibernate 2015

1. Their are five mismatches that occur when storing objects in relational database:granularity,inheritance,identity,associations and
Answers:
• databases
• navigation
• data
• files
2. JDBC stands for_____.
Answers:
• Java DataBase Connection
• Just Do Both Carefully
• Jeremy Does Backflips Consistently
• Java Does Best Connection
3. Which of the following is NOT true about Metamodel?
Answers:
• All
• javax.persistence.metamodel.Metamodel acts as a repository of metamodel objects and provides access to them
• Handle to javax.persistence.metamodel.Metamodel can be obtained from either the javax.persistence.EntityManagerFactory or the javax.persistence.EntityManagervia their getMetamodel method
• The metamodel is a set of objects that describe a domain model
4. Which of the following correctly describes Hibernate Envers?
Answers:
• All
• Facilitates querying historical data
• Facilitates auditing of all mappings defined by the JPA specification
• Facilitates auditing of Hibernate mappings, which extend JPA, like custom types and collections/maps of "simple" types (Strings, Integers, etc.)
5. The configuration object class is used to create a(n) ____?
Answers:
• Rational Database
• SessionFactory
• VariableRepository
• ArrayList
6. Which of the following statements are true about Hibernate catching:
Answers:
• The first level caching is provided by the EntityManager
• Hibernate provides 2 levels of caching
• All of these
• The first level caching is limited to a particular user or request
7. Which is true:
Answers:
• using org.hibernate.Session;
• import org.hibernate.Session
• import org.hibernate.Session;
• using arg.hibernate.Session:
8. If Hibernate does not commit the transaction it can _______.
Answers:
• rollback
• fallback
• backflip
• zip it up
9. Java is a/an _____ language
Answers:
• tough
• Object-Oriented
• javascript
• client
10. Which of the following shortcomings are addressed by Hibernate Search?
Answers:
• The API mismatch
• The structural mismatch
• All
• The duplication mismatch
11. A database _____ data.
Answers:
• grows
• tabs
• stores
• non-persists
12. What instructs Hibernate how to map the classes to the database?
Answers:
• A variable
• xpath mapping file
• XML mapping file
• The Declare statement
13. The createhibernate.cfg.xml is a/an ____ configuration file.
Answers:
• MXL
• XML
• XXML
• LMX
14. Java is to the business logic as ____ is to the database
Answers:
• javascript
• SQL
• vbscript
• perl
15. Hibernate is a high performance ORM.  ORM stands for?
Answers:
• object relational marker
• object redundant marker
• object relational mapping
• object real maker
16. Which of the following XML elements is true for Hibernate?
Answers:
• <hibernate-mapping>
• <hibernate-java-java>
• <hibernate-hibernate>
• <hibernate-tabular>
17. SessionFactory is _____.
Answers:
• delayed
• self-orienting
• thread safe
• lousy
18. Which of the following is TRUE about Hibernate Search?
Answers:
• All
• Hibernate Search provides synchronous and asynchronous index updates
• Hibernate Search works well in non-clustered mode
• Hibernate Search works well in clustered mode
19. Which is true:
Answers:
• Session.Cloak()
• Session.Close();
• Session.Cloak
• Session.Close
20. An ORM solution should consist of which of the following functions:
Answers:
• Specifying mapping metadata
• Specifying queries that refer to classes and properties of classes
• All of these
• Performing basic CRUD operations on objects of persistent classes
21. A persistent framework is a(n) ____ service that stores and gets objects into a database.
Answers:
• modular
• open
• OS
• ORM
22. Which of the following is correct?
Answers:
• catch (HibernateException e)
• catch (OOPException e)
• try (HibernateException e)
• private (HibernateException e)
23. Hibernate takes care of mapping Java to the database using ___?
Answers:
• XML
• XSLY
• xpath
• PL-SQL
24. The reason for Hibernate is because their is a mismatch or impedance between the object model and the ____?
Answers:
• revised database
• redundant database
• rational database
• relational database
25. POJO stands for_____.
Answers:
• Plain Ole Java Object
• Plain Old Java Object
• Plaine Old Java Object
• Plaine Ole Java Object
26. Query objects use ____ to retrieve data from the relational database
Answers:
• Java
• .Net
• HQL
• C#
27. A _______ represents a measure of work done in the database.
Answers:
• transaction
• sproc
• table
• UDF
28. The Hibernate framework is stored in (a) _____.
Answers:
• XML
• javascript
• JAR
• browser
29. Databases represent data in a ____ format.
Answers:
• reformatted
• tabular
• delimited
• delayed
30. Which of the followings might be able to solve N+1 problem?
Answers:
• add @Fetch annotation and specify a FetchMode of SUBSELECT
• All of these
• add @Fetch annotation and specify a FetchMode of JOIN
• use LEFT JOIN FETH clause on the HQL
31. A/an ______ is a primitive data type.
Answers:
• OOP
• SQL
• Integer
• Variable
32. Which of the following is correct?
Answers:
• import org.hibernate.SessionFactory;
• using arg.hibernate.SessionFactory:
• import org.hibernate.SessionFactory
• using org.hibernate.SessionFactory;
33. Which of the following is TRUE about @GeneratedValue annotation?
Answers:
• It is used to specify the identifier property of the entity bean
• It is used to mark this class as an Entity bean
• It is used to specify the primary key generation strategy
• Its is used to specify the table to persist the data
34. Which of the following property needs to be defined to activate second-level caching?
Answers:
• transactionManager
• sessionFactory
• cache.provider_class
• hibernate-configuration
35. Hibernate will assume an instance is an unsaved transient instance if:
Answers:
• All of these
• The identifier property (if it exists) is null
• The version property (if it exists) is null
• You supply an unsaved-value in the mapping document for the class, and the value of the identifier property matches
36. The ____ element is used to link data to the database.
Answers:
• <JAVA>
• <property>
• <XML>
• <HTML>
37. Which of the following is a VALID key component of Hibernate Configuration?
Answers:
• SessionFactory but NEITHER database connection NOR class mapping setup
• Class mapping setup but NOT database connection
• Database connection but NOT class mapping setup
• Both database connection and class mapping setup
38. Which of the following property makes hibernate to generate SQL as per the chosen database?
Answers:
• transaction
• driver_class
• session
• dialect
39. Which of the following are valid Hibernate interceptors?
Answers:
• Both Session-scoped and SessionFactory-scoped
• Session-scoped but NOT SessionFactory-scoped
• SessionFactory-scoped
• Session-scoped
40. Which one of the following statement is NOT true about SessionFactory?
Answers:
• SessionFactory is not lightweight and is expensive to create
• You can use SessionFactory to create Session instance
• The SessionFactory caches generated SQL statements and other mapping meta data that Hibernate uses at runtime
• One SessionFactory can manage more than one database
41. Which one of the following statements is true about detached instance?
Answers:
• A persistent instance will become detached after the session is closed.
• An instance will be detached after it gets retrieved from the database by the execution of query.
• Hibernate does NOT allow you to re-associate detached instances with a new persistence manager.
• Changes made to the detached instance are still guaranteed to synchronize with the database.
42. Which one of the following statements is true about the instance states?
Answers:
• Transient instants can be made persistent by calling delete()
• Transient instants are previously persistent and associated with an unique session
• Persistent instants can be made transient by calling update()
• Detached instants can be made persistent by calling saveOrUpdate()
43. Which of the following correctly describes SessionFactory?
Answers:
• Instances of persistent classes that are not currently associated with a org.hibernate.Session
• A single-threaded, short-lived object representing a conversation between the application and the persistent store
• A thread-safe, immutable cache of compiled mappings for a single database
• Short-lived, single threaded objects containing persistent state and business function
44. Which of the following elements is used to declare the persistent class in Hibernate configuration file?
Answers:
• <property>
• <mapping>
• <session-factory>
• <hibernate-configuration>
45. Which of the following provides an interface between application and data stored in the database?
Answers:
• Transaction
• TransactionFactory
• ConnectionProvider
• Session
46. Which one of the following statements is NOT true about ordering query result?
Answers:
• You cannot order query results by more than one properties
• HQL provides an ORDER BY clause for ordering query result
• The default ordering is ascending
• You can use asc and desc to specify ascending and descending order
47. Which of the following is NOT a valid value for 'hbm2ddl.auto' property in hibernate configuration?
Answers:
• validate
• update
• truncate
• create
48. Hibernate offers an implementation of which specification?
Answers:
• JPA
• ORM
• JMS
• JDBC
49. Which one of the following statements is NOT true about named queries?
Answers:
• Named queries allow externalizing query strings to the mapping metadata
• Named queries are precompiled when session factory is created
• The named query must be HQL strings. Native SQL is not supported in named query
• The getNamedQuery() method obtains a query instance of named query
50. Which one of the following statement is NOT true about Hibernate's Query interface?
Answers:
• You can paging the query result by using setFirstResult() and setMaxResult() method
• If the query returns more than result for the uniqueResult() method, the first one will be returned.
• You can use method chaining (methods return receiving object instead of void) with Query interface
• Both the createQuery() and createSQLQuery() method of Session interface can return a Query instance
51. Which of the following is NOT true about default flush operation in Hibernate?
Answers:
• Hibernate flushes by default before some queries
• Hibernate flushes by default when session.flush() is executed
• Hibernate NEVER flushes by default
• Hibernate flushes by default when commit() is executed
52. Which one of the following statements is NOT true about persistence annotations?
Answers:
• The @Column annotations is used to specify the column name of the foreign key
• The @Id annotation indicates the field is the primary key for the entity
• The @Entity annotation indicates that the class is mapped to a table in database
• The @Table annotation can be used to specify mapping database schema name
53. Which of the following is NOT a type of hibernate cache?
Answers:
• Transaction layer level cache
• Application layer level cache
• First Level Cache
• SQL cache
54. Which one of the following statements is NOT true about comparison operator in HQL?
Answers:
• The where clause is a logical expression evaluating to true false or null
• The HQL where clause supports arithmetic expressions
• You can use = NULL to test whether the value is null
• The "like" operator allows wildcard(%) searches
55. Which of the following statement is TRUE about sorting in Hibernate?
Answers:
• A sorted collection is sorted in-memory using java comparator, while order collection is ordered at the database level using order by clause
• An order collection is sorted in-memory using java comparator, while sorted collection is ordered at the database level using order by clause
• A sorted collection is either sorted in-memory using java comparator or using order by clause at the database level
• An order collection is either sorted in-memory using java comparator or using order by clause at the database level
56. Which of the following is the FIRST Hibernate object that is created in any Hibernate application?
Answers:
• SessionFactory
• Transaction
• Configuration
• Session
57. Which of the following is NOT true about Session and Transaction scope in Hibernate?
Answers:
• In order to reduce lock contention in the database, a database transaction has to be as short as possible
• A Session is an inexpensive, non-threadsafe object that should be used once and then discarded for: a single request, a conversation or a single unit of work
• Multiple instances of SessionFactory are created, usually on application startup, from a Configuration instance
• A SessionFactory is an expensive-to-create, threadsafe object, intended to be shared by all application threads
58. Which of the following is used by Hibernate to redirect the logging output to preferred logging frameworks?
Answers:
• JDK logging
• JCL
• log4j
• Simple Logging Facade for Java (SLF4J)
59. Which one of the following statements is true about  how Hibernate retrieves an object?
Answers:
• You cannot retrieve objects using native SQL queries in Hibernate
• When you're using get() method to retrieve an object that doesn't exist in the database, Hibernate will throw an exception
• When you using load() method to retrieve an object that doesn't exist in the database, Hibernate will return null
• HQL Hibernate Query Language is a full object oriented query language
60. Which one of the following statements is NOT true about using annotation mapping Entity hierarchies?
Answers:
• The @Inheritance annotation has a "strategy" attribute which can be used to define the inheritance mapping strategy
• The @DiscriminatorColumn is used to defined the named of the column that is used to differentiate subclasses
• The root class of the hierarchy needs to be marked by the @Inheritance annotation
• The @DiscriminatorValue doesn't have default value and must be defined.
61. Which of the following statements is NOT true about mapping one class to multiple tables using annotation?
Answers:
• entities may be mapped across multiple tables by making use of the @SecondaryTable annotation
• entities may be mapped across multiple tables by making use of the @SecondaryTables annotation
• The "table" attribute needs to be defined in the @Column annotation to specify which table the column belongs
• The @PrimaryKeyJoinColumn annotation specifies the primary key of the primary table
62. Which of the following statement is NOT true?
Answers:
• The load() method throws an exception,when the unique id could not found in the database
• The load() method returns proxy by default and the data base will not be effected until the invocation of the proxy
• The get() method returns null when the unique id is unavailable in the database.
• The load() method returns null, when the unique id could not found in the database
63. Object-oriented languages represent data as a ____ of objects
Answers:
• tabular
• delimited
• array
• graph
64. Which one of the following statements is NOT true about transient state?
Answers:
• After a persisted instance gets deleted, it'll become a transient instance
• Transient instance is always associated with a row in a database
• Objects instantiated using new operator aren't persisted immediately and their state is transient.
• objects referred by other transient instances are transient
65. Which of the following is NOT true about First Level Cache?
Answers:
• Hibernate uses this cache by default
• It loads objects and make them available to the entire application
• it reduces the number of generated SQL queries within a given transaction
• It always "associates" with the Session object
66. Which of the following is not TRUE about StatelessSession interface/implementation in Hibernate Batch?
Answers:
• A stateless session has no persistence context associated with it
• Operations performed using a stateless session cascade to associated instances
• A stateless session does not implement a first-level cache
• It does not provide many of the higher-level life cycle semantics
67. Which of the following is NOT true about Second Level Cache?
Answers:
• It is called 'second-level' because there is already a cache operating in Hibernate for the duration of an open session
• By default it effectively holds on to the identifiers for an individual query
• It exists as long as the session factory is alive
• It always "associates" with the Session Factory object
68. Which one of the following statements is true about joining associations in Hibernate?
Answers:
• In HQL the LEFT keyword in LEFT JOIN FETCH is optional
• HQL provides a fetch join in the FROM clause to lazy load the associated objects
• When using HQL join queries you have to explicitly specify the join condition using either WHERE or ON clause
• When using outer joins, Hibernate will always return a list containing distinct items.
69. Which of the following is an INVALID LockMode?
Answers:
• OPTIMISTIC_FORCE_INCREMENT
• OPTIMISTIC
• UPDATE
• PESSIMISTIC_FORCE_INCREMENT
70. Which one of the following statements is NOT true about join strategy (table per subclass)?
Answers:
• In join strategy every class will have its state mapped to a different table
• Join strategy is the most efficient way to store data
• It is more is expensive to query subclass when using join strategy
• Join strategy is the most efficient way to insert data
71. Which one of the following statements is NOT true about entity lifecycle events
Answers:
• The PostLoad callback occurs after the data for an entity is read from the database and the entity instance is constructed.
• If the PERSIST cascade option is set on a relationship of an object that is being persisted and the target object is also a new object, the PrePersist event is triggered on the target object.
• When the SQL for deletion of an entity gets sent to the database, the PostRemove event will get fired and it indicates success of deletion
• Firing of a PostPersist event does not indicate that the entity has committed successfully to the database
72. Which of the following correctly describes org.hibernate.cache log category?
Answers:
• Log both first-level and second-level cache activity
• Log NEITHER first-level NOR second-level cache activity
• Log all second-level cache activity
• Log all first-level cache activity but NOT second-level cache activity
73. Which one of the following statements is true?
Answers:
• The load() method can return a poxy than immediately hitting the database.
• The load() method and get() method of Session interface are same
• The get() method of Session interface will throw exception if no row find in the database
• The load() method of Session interface will return null if no row find in the database
74. Which one of the following statements is true about the following HQL query: select department from Department department join department.employees employee where employee.address.state = 'CA' and department.name='marketing'
Answers:
• The query returns a List of Object[] arrays, at index 0 is Department and Index 1 is Employee
• The department objects returned are lazy loaded.
• The query will return all departments not matter the department has an employee or not
• The query is using outer join
75. Which one of the following statements is NOT true about many to many relationship mapping?
Answers:
• mappedBy element must be included for the bidirectional many to many relationship
• The @JoinColumn and @InverseJoinColumns are used to defined the column names of the foreign keys in the join table
• The many to may relationship can be both unidirectional or bidirectional
• The @JoinTable annotation must be defined on the reverse side of the many to many relation ship
76. Which one of the following statement is true about the following query: FROM Item AS item WHERE item.description like ? AND item.date > ?
Answers:
• The query indicates that there is a table named item and has columns named as "description" and "date"
• The FROM WHERE AND are HQL keywords and has to be uppercase
• The index of binding parameter start from 1 instead of 0
• The as keyword is optional
77. Which of the following correctly describes org.hibernate.SQL log category?
Answers:
• Log all JDBC parameters
• Log the state of all entities
• Log all SQL DML statements as they are executed
• Log all SQL DDL statements as they are executed
78. Which one of the following statements is True about the following query: from Item as I where i.description =  :description
Answers:
• this query is using positional parameter binding
• The query is using native SQL syntax
• the letter I is alias and the "as" keyword must be place in front of the alias
• the Item indicates the name of the entity class and it's case sensitive
79. Which of the following is NOT a valid org.hibernate.ConnectionReleaseMode?
Answers:
• AFTER_TRANSACTION
• ON_OPEN
• ON_CLOSE
• AFTER_STATEMENT
80. Which of the following is not a Session method?
Answers:
• Session.saveorupdate()
• Session.remove()
• Session.save()
• Session.persist()
81. Which one of the following statements is NOT true about HQL joins?
Answers:
• Join conditions can be specified explicitly by using the 'join' keyword
• Path navigation from one entity is a form of outer join.
• An inner join between two entities returns the objects from both entity types that satisfy all the join conditions
• Join conditions can be specified implicitly as a result of path navigation.
82. Which of the following is NOT true about Hibernate OGM (still being developed)?
Answers:
• It is a persistence engine providing Java Persistence (JPA) support for NoSQL storage solutions
• It reuses Hibernate Core's object life cycle management and (de)hydration engine but persists entities into a key/value store instead of a relational database
• It reuses the Java Persistence Query Language (JP-QL) as an interface to querying stored data
• It is expected to be used to interact with all NoSQL solution in all use cases
83. Which of the following statements is true about using cache in Hibernate?
Answers:
• Caching query will have more impact on applications that perform many inserts, deletes or updates.
• The query cache cache all the entities properties returned in the query result set
• The iterate()method of the Session and Query interfaces is provided to take advantage of second-level cache.
• To enable query cache all it needs is to invoke setCacheable(true) on the query instance.
84. Which one of the following statements is NOT true about using components in Hibernate?
Answers:
• Hibernate component is the lowest level of unit and cannot own other component
• We can declare a component of an entity by using <component> element
• Hibernate support both unidirectional and bidirectional composition
• Component is the user defined class that is persisted to the table of owning entity
85. Which one of the following statements is true about entity type and value type in Hibernate?
Answers:
• Value type objects belongs to an entity and is embedded in the table row of owning entity
• An object of value type always has a primary key value in the database
• An object of Entity type does NOT have its own database identity
• An Entity type object cannot exist independently and has to bond to another object
86. Which one of the following statements is NOT true about the following HQL query: from Item item join item.bids bid where item.description like '%gc%' and bid.amount > 100
Answers:
• The bids collection of each Item will be eagerly loaded.
• The query returns a List of Object[] arrays
• The query assigns the alias "item" to the class ITEM and alias "bid" to the Bid class
• The query returns all combinations of associated Bids and Items
87. Which one of the following statements is NOT true about Hibernate's cascading persistence?
Answers:
• cascade ="delete" tells Hibernate to navigate the association when performing delete
• cascade="save-update" is the default setup in hibernate
• cascade ="none" tells hibernate to ignore association
• cascade="all-delete-orphan" is the same as cascade="all" in addition it deletes any persistent instant when it get dereferenced
88. Which of the following is NOT true about Hibernate Template?
Answers:
• Since it decouples the application from the spring framework, it is recommended that HibernateTemplate is always used for integration
• They perform common setup routines for you, let you skip the boilerplate and concentrate on the logic you want
• It automatically open and close sessions and commit or rollback transactions after the code execution
• All Hibernate Template features can be achieved in an aspect-oriented way using Spring's Declarative Transaction Management
89. Which one of the following statements is true about using annotation to setup Inheritance Models?
Answers:
• the @Inheritance annotation is used on the subclass to setup the inheritance mapping strategy
• the name element of @DiscriminatorColumn annotation specify the name of table
• the @DiscriminatorValue annotation is used to specify the value in the in the discriminator column in database
• The default value of discriminatorType element in @DiscriminatorColumn is DiscriminatorType.INTEGER
90. Which of the following is NOT a valid caching strategy?
Answers:
• Write-only
• Nonstrict read/write
• Read-only
• Read/write
91. Which one of the following statements is NOT true about entity lifecycle events?
Answers:
• UpdateTimestampsCache is a special cache region that holds timestamps of the most recent updates to each table
• Hibernate allows you to specify a different named cache region for each query
• The query cache must be enabled using a Hibernate property setting:hibernate.cache.use_query_cache true
• If the timestamp of the most recent update made to the queried table is early than the timestamp of the cached query results, then the cached results are discarded
92. Which one of the following statements is NOT true about embedded objects?
Answers:
• The @AttributeOverride annotation defines what type the database uses to save the embeddable field
• User @Emebeddable on a class means it's fields and properties will be persistable as part of another entity.
• The Embeddable type can be reused on other types
• The @Embedded annotation means the annotated field is embeddable type
93. Which of the following does NOT correctly describe LockMode.NONE?
Answers:
• If an object is requested with this lock mode, a WRITE lock will be obtained if it is necessary to actually read the state from the database
• Objects associated with the session via a call to update() or saveOrUpdate() also start out in this lock mode
• All objects switch to this lock mode at the end of a Transaction
• It represents the absence of a lock
94. Which one of the following statements is NOT true about hibernate Session?
Answers:
• Session is Hibernate's interface for persistence-related operations such as storing and retrieving objects
• An instance of Session is lightweight and is inexpensive to create and destroy.
• Hibernate session has nothing to do with the web-tier HttpSession.
• Hibernate can detect changes to the objects and make updates to the database automatically even if changes are made within the same session.
95. Which one of the following statements is NOT true about using annotation to map Compound Primary Key?
Answers:
• The primary key class must include equals() and hashCode() method
• The primary key class must be private, but it's optional to implement Serializable
• The primary key class needs to be marked with @IdClass annotation
• Mapping compound primary key requires creating a separate primary key class containing the primary key fields
96. Which of the following is not a VALID hibernate interceptor event?
Answers:
• SelectEvent
• SaveOrUpdateEvent
• ReplicateEvent
• PersistEvent
97. Which of the following is NOT a valid id generator class?
Answers:
• sequence
• identity
• primary
• hilo
98. Which one of the following statement is NOT true about many to one relationship mapping?
Answers:
• The @JoinColumn must be defined with @OneToMany annotation
• If the relationship is bidirectional mappedBy attribute must be defined for the @OneToMany annotation
• The @ManyToOne defines a single-valued association to another entity class that has many-to-one multiplicity.
• The @JoinColumn defines the name of the foreign column
99. Which of the following statements is True about one to one relationship mapping?
Answers:
• mappedBy element should be specified in the @OneToOne annotation in the entity that defines a join column
• One to one mapping can only be bidirectional
• One to one mapping can only be unidirectional
• The @JoinColumn annotation goes on the mapping of the entity that is mapped to the table containing the foreign key
100. Which one of the following statement is NOT true about single table  inheritance strategy?
Answers:
• There shouldn't be any columns left unfilled in the single table strategy
• The single table strategy uses one table to contain all the possible state of a hierarchy
• The single table strategy is the most performance way in polymorphic queries and write operations.
• Single table strategy will be more wasteful of database space.
101. If you want to save your modifications at any time without knowing about the state of an session, then which of the following operations will you use:
Answers:
• Both Merge and Update
• Update
• Neither Merge nor Update
• Merge
102. Which of the following is NOT true about SessionFactory?
Answers:
• Its initialization process is expensive as it loads all configurations including database setting, OR settings
• Configures HIBERNATE with HIBERNATE configuration file for use in application
• It helps in customized extraction of data.
• Its a Singleton class
103. Which of the following is NOT a valid CascadeType value?
Answers:
• REFRESH
• MERGE
• PERSIST
• DELETE
104. Which of the following is NOT a valid layer in hibernate framework?
Answers:
• hibernate framework layer
• backhand API layer
• transaction layer
• java application layer
105. Which of the following is NOT true about sharding in Hibernate (Hibernate Shards)?
Answers:
• Hibernate Shards primarily consists of shard-aware implementations of many of the Hibernate Core interfaces
• Hibernate Shards can be conceptually divided into Generalized sharding logic and Application specific sharding logic
• Hibernate Shards can be conceptually divided into Generalized sharding logic, Application specific sharding logic and Hibernate Default sharding
• The primary goal of Hibernate Shards is to enable application developers to query and transact against sharded datasets using the standard Hibernate Core API
106. Which one of the following statements is true about the following HQL query: select p.number from employee e join e.phones p
Answers:
• This query is using outer join so it'll return all the Phone entity instances no matter it is associated with an Employee or not.
• The query indicates that the "number" is the name of one of the columns of the Phone table
• This query is missing the joining condition so it won't work
• Because the "phones" is a collection association field, the path navigation couldn't continue
107. Which of the following is NOT a valid hibernate performance tuning strategy?
Answers:
• Set ReadOnly to "true" on Queries and Criteria, when objects returned will never be modified
• Set FlushMode to "Never" on Queries and Criteria, when flushing is not necessary at this point
• Avoid clearing the whole Session after flushing
• Avoid join duplicates
108. Which of the following statements is NOT true about persistent instance?
Answers:
• Any change made on the persistent object will be synchronized with the database after the transaction ends.
• A persistent instance has a primary key set as its database identifier
• Before session get closed, an object will becomes persistent after it get saved by the persistence manager's save() method.

• An object is not persistent if it's retrieved from the database by the execution of query.

No comments:

Post a Comment