Font size
WorksheetsMilestone-4 MCQ Practice Test
Total questions: 80
Worksheet time: 1hrs 17mins
Which of the following is true about ORM?
ORM stands for Object-Relational Mapping
ORM is a programming technique for converting data between relational databases and object oriented programming languages
Both
None
In which file database table configuration is stored?
.dbm
.hbm
.ora
.sql
Which of the following is not a state of object in Hibernate?
Persistent()
Detached()
Attached()
Transient()
Which of the following object is used to create SessionFactory object in hibernate?
SessionFactory
Transaction
Configuration
Session
Which of the following is true about query level cache in hibernate?
Query level cache requires two additional physical cache regions that hold the cached query results and the timestamps when a table was last updated
Query level cache is an optional feature
Query level cache is only useful for queries that are run frequently with the same parameters
All of the above
Which of the following are most common configuration methods of Hibernate Configuation
Http.conf
XML Configuration hibernate.cfg.xml
Web.config
Mapping files
Which of the following is FALSE about Session in hibernate
Session represents a single unit-of-work with the database
Session is the primary interface for the persistence service
Session is a light weight non-threadsafe object
You can share the session between threads
Which of the following is NOT a mapping association used in Hibernate?
One-to-Many Association
One-to-One Association
Many-to-Many Association
None
Which of the following is true about hibernate annotations?
All the metadata is clubbed into the POJO java file along with the code this helps the user to understand the table structure and POJO simultaneously during the development
Hibernate Annotations is the powerful way to provide the metadata for the Object and Relational Table mapping
Both of the above
None of the above
Transient and detached objects in hibernate are
Instances of persistent class that are not currently associated with session
Instances of persistent class which are in session
org.hibernate.cfg.Configuration can be used for all configuration and no need of XML.
False
True
Persistent objects and collections in hibernate are
Short-lived, single threaded objects
Long-lived, multi threaded objects
Is it necessary to use hibernate.cfg.xml for configuration in hibernate?
Yes
No
In the elements of Hibernate architecture is a factory of session and client of ConnectionProvider, It holds the second level cache (optional) of data is ?
Session
Transaction
SessionFactory
ConnectionProvider
Hibernate is an?
Open Source
Lightweight
ORM
All mentioned above
1. Which of the following is not a core interface of Hibernate?
a) Configuration
b) Criteria
c) SessionManagement
d) Session
2. Which of the following methods hits database always?
a) load()
b) loadDatabase()
c) getDatabase()
d) get()
3. Which of the following is not an advantage of Hibernate Criteria API?
a) Allows to use aggregate functions
b) Cannot order the result set
c) Allows to fetch only selected columns of result
d) Can add conditions while fetching results
4.Which ways are used by the Log4j and Logback frameworks in hibernate framework to support logging?
a. By log4j.xml file
b. By log4j.properties
c. Both A & B
d. None of the above
5.We need to specify @Inheritance(strategy=InheritanceType.JOINED) in the parent class and @PrimaryKeyJoinColumn annotation in the subclasses.
a. True
b. False
6.Abbreviate the term HQL?
a. Hibernate Queue Language
b. Hibernate Query Language
c. Hipher Query Language
d. None of the above
7.Which of the following is NOT a mapping association used in Hibernate?
A. Many-to-Many Association
B. One-to-Many Associationcorrect
C. One-to-One Association
D. None
8.Which of these simplifies an Object Relational Mapping tool?
A. Data creation
B. Data manipulation
C. Data access
D. All mentioned above
Spring is licensed under
GNU
Apache License 2.0
GNU Lesser General Public License
Open source
Spring is developed by
Red Hat Software
Daniel Fernández
Apache
Pivotal Software
Which spring module provides the capability of DI or IOC?
Spring web
Core container
AOP
Data access
POJO abbreviation
plain old java object
practical java object
project java object
plain oriented java object
is used to create the objects wire them together
java
injection
container
object
EJB abbreviation
Enterprise java beans
Enrich java beans
Emerge java beans
Enlight java beans
____supports transaction management
JSP
EJB
JTS
DAO
___________modules support aspect oriented
programming implementation where you can use Advices,
Pointcuts etc. to decouple the code.
AOP
DAO
JSP
JDBC
In spring _________ tool is used
swing
hibernate
maven
struts
True or False: You can declare a controller class by using the @Controller annotation
True
False
To map the controller class and its methods with URL you must use
@Controller
@Override
@RequestMapping
@ControllerMapping
Given the following code, how should you invoke show.jsp in the browser’s address bar? Note that View Resolver is already in place.
<host>/show.jsp
<host>/form/display.jsp
<host>/display.jsp
<host>/form/show
Which of the following contains your business logic and handles request?
Web Browser
Controller
Model
View
Given the following code, what would be the value of the model attribute “name”
JUAN DELA CRUZ
Juan dela Cruz
JUAN dela Cruz
juan DELA CRUZ
Given the following code, what is the equivalent getter method of firstName in student class in Java?
student.getFirstName
student.getfirstName
student.firstName
None of the above
How do you represent the drop-down list in Spring MVC Tag?
<form:drop>
<form:dropDown>
<form:list>
<form:select>
What is the default value of an input tag?
number
date
text
This component contains the data of the application.
Controller
Model
View
None of the above
Which annotation is used in Spring Boot for mapping HTTP requests to controller methods?
@RequestMapping
@ResponseBody
@RestController
@Autowired
Which HTTP status code indicates that the requested resource was not found?
200
404
500
401
Hibernate is a
Database connectivity Tool
ORM framework
Query Executer
None of the Above
It is a Java specification that provides certain functionality and standard to ORM tools.
Hibernate
JPA
Dev Tools
Spring Data
Which annotation is used for mapping the primary key of an Entity in Hibernate/JPA?
@PrimaryKey
@Id
@PK
@Key
Hibernate uses which API internally for communicating with the Database?
JPA
JDBC
JTA
JMS
Which of the following is true about ORM?
ORM stands for Object-Relational Mapping
ORM is a programming technique for converting data between relational databases and object oriented programming languages
Both
None
Hibernate is an?
Open Source
Lightweight
ORM
All mentioned above
What is the core container module in the Spring Framework?
Spring Boot
Spring Web
Spring MVC
Spring IoC
Which embedded web server is supported by default in Spring Boot?
Tomcat
GlassFish
WildFly
Jetty
What does the term "Inversion of Control" (IoC) refer to in Spring?
A control statement in programming logic
A design pattern for creating classes
The process of controlling hardware devices
The management of object dependencies by a container
Which of the following is a microframework built on top of the Spring Framework?
Spring Data
Spring Boot
Spring Security
Spring Cloud
Building a project includes______
Compiling
Packaging
Running Tests
Deploying
Which of the following file is used to add plugins/ dependencies to your maven project?
package.json
index.jsp
pom.xml
pom.json
What is an archetype in maven?
A template for any type of Java project
package for maven librairies
configuration file
source package
Maven is _____
Project management tool
Build tool
Dependency manager
All of these
Which of the following is not a valid archive file type?
jar
war
ear
car
Which of the following is NOT a benefit of using Spring Boot for web service development?
Minimal XML and annotation-based configuration
Rapid application development with minimal boilerplate code
Complicated setup process
Easy integration with other Spring modules
Which annotation is used in Spring Boot for mapping HTTP requests to controller methods?
@RequestMapping
@ResponseBody
@RestController
@Autowired
What is the purpose of using tools like Postman in web service development?
To automate server deployment
To generate HTML templates
To interact with and test HTTP APIs
To debug Java code
Which annotation in Spring Boot is used for versioning the API?
@RequestMapping
@RestController
@PathVariable
@SpringBootApplication
Which HTTP method is used to retrieve data from a server in RESTful services?
GET
POST
DELETE
PUT
What is the purpose of ResponseEntity<T> in Spring Boot?
To handle HTTP request headers
To manage database transactions
To customize HTTP response entities
To parse XML data
Which of the following is NOT a component of the MVC architecture in Spring Boot?
Model
View
Service
Configuration
What does the @PathVariable annotation in Spring Boot do?
It maps the request body to a method parameter
It extracts values from the URI path
It defines the version of the API
It specifies the HTTP method to use
Which HTTP status code indicates that the requested resource was not found?
200
404
500
401
What is the purpose of the @RestController annotation in Spring Boot?
To define the version of the API
To handle HTTP requests
To specify the HTTP method to use
To provide a way to version the API
Hibernate is an implementation of the Java Persistence API (JPA) specification.
TRUE
FALSE
It is a Java specification that provides certain functionality and standard to ORM tools.
Hibernate
JPA
Dev Tools
Spring Data
It is an open source Java-based framework used to create stand-alone, production-grade Spring based Applications that you can "just run"
Spring Data
Spring JPA
Spring Boot
Spring MVC
It is mainly used to expose operational information about the running application — health, metrics, info, dump, env, etc
Dev Meter
Spring Starters
Dev Tools
Actuator
Which is not a source folder
src/test/java
src/main/java
scr/main/test
scr/main/resources
it contains information of configuration for the maven to build the project such as dependencies, build directory, source directory, test source directory, plugin etc.
maven wrapper configuration
application.properties
pom.xml file
application.xml
It is a web-based tool to generate the structure of the Spring Boot Project.
Spring Resource Manager
Spring Project Generator
Spring Boot Starter
Spring Initializr
What is the output of the program when accessed to context root URL?
Hellostar
whitelabel error page
Hello***********
None of the above
Application.properties file has user defined property named game.name. Choose the correct way in accessing this property and pass it into a variable.
'@Value("$(game.name)") private String gameName;
String gameName = properties.get("$(game.name)");
'@Value("${game.name}") private String gameName;
String gameName = properties.get("${game.name}");
Which of the following is not TRUE.
Spring Boot provides default configurations to build Spring-powered framework.
Spring Boot does not need to build configuration manually.
Spring Boot specifies each dependency separately.
Spring Boot reduces development time and increases productivity
