Using DTOs with JPA

Поділитися
Вставка
  • Опубліковано 19 вер 2024
  • In this video, I'll discuss using DTO's on JPQL queries and the usefulness of this technique.
    Code on GitHub: github.com/lsp...

КОМЕНТАРІ • 19

  • @aziztolearn
    @aziztolearn 2 роки тому +2

    thank you Mr Spilca. You're doing great work for us

  • @MateoEstudiante
    @MateoEstudiante Рік тому +1

    Thanks for the tutorial, I learnt a lot 😊

  • @thebibeksaha
    @thebibeksaha Рік тому +1

    Hi Laur! First of all I love your books and videos and I am currently following your JPA livestreams but I can see you are also doing livestreams on Spring Data JPA, if it is not too much to ask can you please bundle them together into a playlist, that would be very very helpful

  • @acronis536
    @acronis536 2 роки тому +1

    From my understanding @Transactional (readonly=true) is a mechanism through which the initial entity state(fetched from the database) will not be kept in the context anymore (for dirty checking purposes) so it would save some memory. and also some CPU cycles...since dirty checking will be skipped (because there is no initial state to compare your entity to anymore)

    • @laurspilca
      @laurspilca  2 роки тому

      Yes. I think that's a good summary.

  • @abbasmastan7793
    @abbasmastan7793 Рік тому

    sir please make a separate video using custom mapper class for dto in layer architecture with diagram I am waiting for such a amazing context

  • @OmprakashYadavIIT
    @OmprakashYadavIIT Рік тому

    Awesome video

  • @laurspilca
    @laurspilca  2 роки тому +5

    Code on GitHub: github.com/lspil/youtubechannel/tree/master/jpa_with_dtos

  • @KiranKumar-ww3zq
    @KiranKumar-ww3zq 2 роки тому +1

    Can you please create one video on JPA. Where we can perform PLSQl features like procedure, views, and Functions…

    • @laurspilca
      @laurspilca  2 роки тому +4

      Sure Kiran. I'll schedule a live event on this subject.

    • @KiranKumar-ww3zq
      @KiranKumar-ww3zq 2 роки тому +1

      Thanks a lot..

  • @lenigaussgauss2428
    @lenigaussgauss2428 2 роки тому +1

    Hello Sir Thanks again for this great course. I want to know please, why are you using three double qotes in the @Query anotation rather than one double qote

    • @laurspilca
      @laurspilca  2 роки тому +2

      Hi. I'm using the new Java text blocks syntax. It helps you easier write Strings on more lines. Because usually in practice JPQL and SQL queries are on multiple lines, using text blocks is very helpful. Check out this video where text blocks are also described: ua-cam.com/video/FgGmnMq3UqE/v-deo.html

    • @lenigaussgauss2428
      @lenigaussgauss2428 2 роки тому +1

      @@laurspilca Thank you so much

  • @akashdubey5516
    @akashdubey5516 2 роки тому +2

    Is this part of your jpa playlist or spring playlist??

    • @laurspilca
      @laurspilca  2 роки тому +2

      Nope. Just a random live to answer a question.

  • @mohamedbenhamza9014
    @mohamedbenhamza9014 Рік тому

    hi,
    How the productRepository is injected without the @Repository annotation on ProductRepository interface.

    • @laurspilca
      @laurspilca  Рік тому +1

      Hi. Good question. Rememeber first the role of the @Repository annotation. This annotation is part of the family that we call stereotype annotations together with @Component, @Service and @Controller.
      The purpose of a stereotype annotation is to tell Spring to create an instance of the annotated class and add it to the app context.
      That is why you never use a stereotype annotation with any abstract structure. It makes not sense to add any of these annotations on interfaces and abstract classes since they can't create instances, therefore a stereotype annotation here is useless.
      In this case, Spring Data uses dynamic proxies and registers itself an instance in the app context. This instance can be injected now using @Autowired.
      I hope this helps you understand this case.

    • @mohamedbenhamza9014
      @mohamedbenhamza9014 Рік тому

      @@laurspilca Thanks