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