Flashcards

Quick study sessions to strengthen memory and retain key concepts.

Flashcard Study

Java: Persistence and Validation

Front

How can bean validation enhance application security?

By rejecting invalid data early, reducing attack vectors. Bean validation helps avoid common security issues like SQL injection…

View Card →
Flashcard Study

Java: Persistence and Validation

Front

How does @NotBlank improve data validation?

@NotBlank ensures a string is not null and not empty. Applying @NotBlank to a string field ensures it's…

View Card →
Flashcard Study

Java: Persistence and Validation

Front

Why is constructor injection often preferred in Spring?

Constructor injection ensures immutability and testing ease. Using constructor injection enforces dependency requirements at object creation, leading to…

View Card →
Flashcard Study

Java: Persistence and Validation

Front

How would you explain the challenge with transaction self-invocation in an interview?

Spring transactions don't work correctly during self-invocation. When a method calls another method within the same class, Spring's…

View Card →
Flashcard Study

Java: Persistence and Validation

Front

How does @Valid support early input rejection?

@Valid ensures data meets constraints before method execution. By placing @Valid on a method parameter, Spring checks the…

View Card →
Flashcard Study

Java: Persistence and Validation

Front

What is Java Bean Validation in Spring Boot?

A mechanism to ensure data integrity by applying constraints to Java beans. Java Bean Validation in Spring Boot…

View Card →
Flashcard Study

Java: Persistence and Validation

Front

Why does using @NotBlank on a field matter in practice?

It ensures the field is not null or empty. Using @NotBlank on a field in a data class…

View Card →
Flashcard Study

Java: Persistence and Validation

Front

What are the consequences of improper bean scope selection?

It can lead to inefficient resource use or data inconsistency. Selecting the wrong bean scope can cause performance…

View Card →
Flashcard Study

Java: Persistence and Validation

Front

How can bean validation improve application security?

By enforcing constraints, it prevents invalid data from causing harm. Bean validation enhances security by ensuring that data…

View Card →
Flashcard Study

Java: Persistence and Validation

Front

How would you explain a common mistake with bean scopes in Spring in an interview?

Using singleton scope for stateful beans. Frame the concept in practical terms so you can explain it during…

View Card →