1/255
Looks like no tags are added yet.
What is Spring?
A Java framework used to build web applications, APIs, and enterprise applications.
What is dependency injection?
Supplying dependencies to an object instead of creating them inside the object.
What is inversion of control (IoC)?
Outsourcing object construction and management to the Spring container.
How is DI related to IoC?
Dependency injection is a way to implement the inversion of control principle.
What is Spring Boot?
A framework built on Spring that simplifies setup with auto-configuration and embedded servers.
Spring vs Spring Boot?
Spring is the foundation; Spring Boot reduces manual configuration and startup effort.
What is convention over configuration?
Using sensible defaults instead of manually configuring everything.
What is Spring Initializr?
A tool for generating a Spring Boot starter project with dependencies and build files.
Which build tools can Spring Initializr generate?
Maven and Gradle.
What is Spring Tools Suite?
Tooling for Spring development, traditionally Eclipse-based and also supporting VS Code.
What is a JAR file?
A Java archive; Spring Boot executable JARs commonly include an embedded web server.
What is a WAR file?
A web application archive traditionally deployed to a separately configured server.
How do you start a Maven Spring Boot application?
Run mvn spring-boot:run or use the Maven wrapper.
What is Spring Boot's default web port?
8080
What is pom.xml?
The Maven file for dependencies, plugins, and build configuration.
What is the Maven Wrapper?
Project scripts such as mvnw that run Maven using the project's specified distribution.
What are application.properties and application.yml?
Files for application configuration, such as ports, database credentials, and logging.
Where does static web content usually go?
src/main/resources/static.
What are server-side templates for?
Rendering markup views on the server instead of just returning JSON.
What does spring-boot-starter-web include?
Dependencies for REST and web development, including Spring MVC and a servlet server.
What does spring-boot-starter-data-jpa include?
Spring Data JPA integration, with Hibernate commonly acting as the JPA provider.
What does spring-boot-starter-test include?
Testing support such as JUnit, Mockito, and Spring Test.
What is the Spring Boot starter parent?
A Maven parent providing dependency versions and useful build defaults.
What is DevTools?
Development tools that help restart applications after code changes.
What is Spring Boot Actuator?
A project exposing operational endpoints, including health and metrics.
What does /actuator/health report?
Application health status, often UP or DOWN.
Why restrict Actuator endpoint exposure?
Operational details can expose sensitive system information.
Where can logging levels be configured?
In application.properties or application.yml.
What does a Spring container do?
Creates, configures, injects, and manages bean lifecycles.
What is a Spring bean?
An object managed by the Spring container.
What is constructor injection?
Passing dependencies through a constructor; preferred for required dependencies.
What is setter injection?
Supplying dependencies through setter methods after construction.
What is field injection?
Injecting dependencies directly into fields; generally less testable.
What is @Autowired?
An annotation used to request dependency injection from Spring.
What is @Component?
An annotation identifying a class as a Spring-managed component.
What does component scanning do?
Discovers eligible component classes in configured packages.
What does @SpringBootApplication encompass?
Boot configuration, auto-configuration, and component scanning.
What does @Qualifier do?
Selects a specific bean when multiple beans match the same type.
What does @Primary do?
Marks a preferred bean among multiple matching candidates.
What is default bean scope?
Singleton, meaning one bean instance per container bean definition.
What is prototype scope?
A new bean instance is created each time the container is asked for one.
What does @Lazy do?
Delays bean initialization until first needed.
What does @PostConstruct do?
Marks an initialization method run after dependency injection.
What does @PreDestroy do?
Marks a cleanup callback before a managed bean is destroyed.
Why use @Configuration and @Bean?
To explicitly register beans, including types you cannot annotate yourself.
What is ORM?
Object-relational mapping between Java objects and relational database tables.
What is Hibernate?
An ORM implementation that persists Java objects to relational databases.
What does JPA stand for?
Jakarta Persistence API, a specification for Java object persistence.
How is Hibernate related to JPA?
Hibernate implements the JPA specification.
Why use Hibernate instead of plain JDBC?
It reduces manual SQL, result mapping, and persistence boilerplate.
Which JDBC driver is used in the slides for PostgreSQL?
The PostgreSQL JDBC driver, org.postgresql:postgresql.
Which properties commonly connect Spring to a database?
spring.datasource.url, spring.datasource.username, and spring.datasource.password.
What is EntityManager?
The JPA API for interacting with a persistence context and managing entities.
What is JpaRepository?
A Spring Data abstraction offering CRUD, sorting, pagination, and queries.
EntityManager vs JpaRepository?
EntityManager provides lower-level control; JpaRepository simplifies common CRUD work.
What is a persistence context?
The managed set of entity instances tracked by a JPA provider.
What is Hibernate Session?
Hibernate's API for interacting with persistent entities and the database.
What is JPQL?
A query language that uses entity names and properties rather than database table names.
What is HQL?
Hibernate's query language, similar to JPQL with Hibernate-specific extensions.
What is native SQL?
Database SQL that directly references tables and columns.
What does SELECT s FROM Student s reference?
The Student entity class, not necessarily a table called Student.
What does @Entity mark?
A class representing a persistent JPA entity.
What does @Id mark?
An entity's primary-key attribute.
What does @GeneratedValue configure?
Automatic primary-key generation.
What does @Service mark?
A Spring component holding business logic.
What does @Repository mark?
A Spring component handling data access.
What does @RestController mark?
A controller whose request handlers typically return response bodies such as JSON.
What is Jackson?
A library for converting Java objects to and from JSON.
What is serialization?
Converting a Java object into JSON or another transport format.
What is deserialization?
Converting JSON into a Java object.
What does @NotNull validate?
A value must not be null.
What does @NotEmpty validate?
A string, collection, or array must not be null or empty.
What does @NotBlank validate?
A string cannot be null, empty, or whitespace-only.
What does @Valid trigger?
Bean Validation for an annotated argument or object.
What does @Column(nullable=false) request?
A non-null database column constraint in generated schema mapping.
What is a custom runtime exception for?
Representing an application-specific error such as a missing record.
What is @RestControllerAdvice?
Global REST controller advice, often used for exception handling.
What does @ExceptionHandler do?
Maps a particular exception type to a handler method.
Why return ResponseEntity?
To specify an HTTP status, headers, and response body.
What does @Transactional do?
Declares a transaction boundary managed by Spring.
What is REQUIRED propagation?
Joins an existing transaction or creates one if absent.
What is REQUIRES_NEW propagation?
Suspends the current transaction and starts a separate one.
What does transaction isolation control?
How concurrent transactions see each other's changes.
What does @OneToOne map?
A relationship with one related entity on each side.
What does @OneToMany map?
One entity related to multiple others.
What does @ManyToOne map?
Multiple entities related to one parent entity.
What does @ManyToMany map?
Multiple entities on each side related to multiple on the other.
What does mappedBy identify?
The owning-side property of a bidirectional JPA relationship.
Why create a join entity for many-to-many?
To store additional attributes about the relationship itself.
How do you declare a repository?
An interface extending JpaRepository
What can JpaRepository.findById return?
Optional
What are derived query methods?
Repository query methods parsed from names such as findByEmail.
What does countByStatus mean?
Count entity records where the status property matches.
What goes after By in a derived method name?
Entity property names and conditions that define the filter.
When should you avoid derived query methods?
When query names become too long or relationship traversal becomes complex.
What does @Query do?
Defines a custom JPQL or native SQL repository query.
What does Pageable represent?
Pagination input, including page number, size, and often sorting.
What is a DTO?
A data transfer object that shapes request or response data.
Why use DTOs?
To control API data and separate API contracts from persistence entities.
How can derived queries navigate relationships?
With property paths, including underscores to disambiguate traversal.