stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Hibernate Flashcards | StudBud
Explore
/
Hibernate
Hibernate
30 terms
·
StudBud Administration
·
66 plays
Burr it is cold, best get into a database to warm yourself up.
Flashcards
30 cards
F
Practice quiz
P
Host live
L
Questions
30
Answers
1
Which is not true about HQL
Stands for Hibernate Query Language
Queries are translated by Hibernate into conventional SQL queries
Doesn't operate on tables and colums, but persistent objects and properties
Clauses and properties like table and columns are case sensative
2
What is not true about Hibernate?
Supports eager initialization and fetching strategies
Generates much of the SQL at system initialization time
It is an implementation of the JPA specification
Enables persistent classes following OOP
3
Which is not a main rule of persistent classes?
Should contain an ID in order to allow easy identification of objects
Needa default constructor
Proxies depend on the persistent class being non-final
All attributes to be persisted should be declared protected
4
What is the root element of the <classname>.hbm.xml file?
<hibernate-mapping>
<hibernate-core>
<hibernate-class>
<hibernate-generator>
5
Which is not a javax.persistence annotation
@Table
@PrimaryKey
@GeneratedValue
@Id
6
What is not true about bootstrap
Hibernate bootstrap makes configs less complex than the JPA bootstrap API
The process of building a fully functional SessionFacotry Instance for JPA
Predefined CSS classes created by Twitter
Refers to the initialization and starting of a software component
7
What is not true about SessionFactory Objects
Persistent objects are not saved and retrieved through this
Generally have one SessionFactory object per database using dif. cfg.xml
They are threadsafe
Is a lightweight object, created during application startup
8
Which is not true
RDBMS's represent data in a tabular format
ORM's are the solution to impedance mismatches between RDBM's and OO langs
Java represents data in a interconnected graph of objects
ORM's is a programming lang for converting data between RDBS's and OO langs
9
T/F org.hibernate.usertype.UserCollectionType allows you implement any collection
True
False
10
What is a session object?
An optional object, that is unit of work with the database
Used to get a physical connection witha a database
Creates a SessionFactory object which in turn configures Hibernate for app
An object that uses SQL or HQL string to retreive data from the database
11
Which is a requirement for all persistent classes?
Package or private visibility for runtime proxy generation
Standard JavaBean naming conventions for property getter and setter methods
private visability for fields
no-arg constructor
12
Objects that are used to create and execute object oriented criteria queries to retrieve objects are:
SessionFactory objects
Criteria Objects
Query Objects
Transaction Objects
13
T/F When we work with an object oriented system there is a mismatch between the object model and the relational database
True
False
14
Which is one of the three states for instances of mapped entity classes?
dispatched
traspiring
persistent
transparent
15
What is the main Hibernate ORM artifact
hibernate-entity
hibernate-core
hibernate-object
hibernate-org
16
T/F Tables mapped in Hibernate do not need to define primary keys
True
False
17
Which hibernate property would you not need to configure for a database
hibernate.connection.password
hibernate.dialect
hibernate.connection.driver_class
hibeernate.connections.url
18
Which is not true about the @Id annotation
The primary key can only be a single field
Will automatically determin the most appropriate primary key generation
You can override @Id with @GeneratedValue
Each entity bean will have a primary key that you annotate on the class
19
T/F Persistent objects are saved and retrieved through a Session object
False
True
20
T/F Session objects are not thread safe
True
False, they are not usually thread safe
False, they are always thread safe
False, only SessionFactory is not thread safe
21
Which is not an interface of the Hibernate architecture
SessionFactory
Transaction
Session
Configuration
22
Which is not true
Named Query is statically defined with predefined unchangeable query string
Hibernate annotations define mappings without the use of the XML file
Criteria API is used to query the database, and can't use and DDL
Session.addCriteria is used to add criterion to a SQL query
23
T/F Session instances are not serializable if its persistent classes are serializable
False
True
24
What is Hibernate?
Is concerned with data persistence as it applies to operational databases
Is an extension of the JPA specification
Requires interfaces or base classes for persistent classes
An ORM that enables devs to more easily write applications
25
Which is true about Hibernate?
Takes care of the mapping for Java methods to database tables
Is highly configurable and inextensible
Desined to work in an app server cluster and deliever scalible apps
Helps remove vendor specific SQL code and create data-centric apps
26
T/F: Hibernate's functionality is split into modules
False
True
27
Which is not an advantage ORM has over plain JDBC?
Entites based on business concepts rather than database structure
Transactional managment and automatic key generation
Hides details of SQL queries from OO logic
Allows business code access DB tables rather than objects
28
Which is not true about the hbm.xml
Uses mapping metadata to determine how to load and store objects
hbm.xml is the only choice for providing Hibernate with mapping metadata
It uses Java reflection when the files are processed
The hibernate.cfg.xml defines the hibernate configuration information
29
Which is not true
The default table name for every table is the class name
@javax.persistence.Entity annotation is used to mark a class as an entity
Attributes of an entity are persistent by default with mapping annotations
@javax.persistence.Date property handles date naming conventions
30
Which dialect should not be used with Hibernate?
MongoDB
Oracle
PostgresSQL
MySQL