Java spring boot interview Questions And Answers Rated 100%!!!
2 views 0 purchase
Course
JPA
Institution
JPA
What is implementation and interface inheritance? - ANS check chatgpt
What type of exception is a null pointer exception in Java? - ANS Null pointer exception is a type of runtime exception in Java.
What are runtime exceptions in Java? - ANS exception that occur at run...
Spring Cert 2024 | Chapter 4 | Data JPA
Exam Questions And Answers
What is a Spring Data Repository interface? - ANS Aims to significantly reduce the amount
of boilerplate code required to implement data access layers for various persistence stores.
How do you define a Spring Data Repository interface? [2] Why is it an interface not a class? -
ANS a) Define Entity Class
b) Create an Interface (@Repository)
==> Should extend 1/4 Repository types
==> Should be parametrized w/ Entity type
public interface UserRepo extends JpaRepository<User, Long>
What is the naming convention for finder methods in a Spring Data Repository interface [4]? -
ANS 1) Verb [1/6] - {get, read, find, query, stream, count}
2) Limiter (Optional)
3) Subject (Optional)
4) Predicate [2] - consists of...
==> a) Property (required)
==> b) Comparison (optional, default is "equals")
[JAY] Regarding Spring Data Repository Interface methods' naming conventions, what parts are
optional [2]?
What part of the Predicate is optional? What does it default to? - ANS 1) Limiter - "first",
"top", etc.
2) Subject - Since Repo-Type is already parameterized w/ correct type
Predicate - Comparison is optional (defaults to "equals")
How are Spring Data repositories implemented by Spring at runtime? - ANS JDK Dynamic
Proxy - Intercepts all calls to repository
==> Routes calls to default repository impl (SimpleJpaRepository)
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller DocLaura. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $10.29. You're not tied to anything after your purchase.