5 Tips To Write Efficient Queries With JPA And Hibernate

Поділитися
Вставка
  • Опубліковано 15 сер 2017
  • A lot of developers seem to have a love-hate relationship with JPA and Hibernate. They love it because it makes it easy to implement most use cases and they hate it because it also makes it easy to implement very inefficient queries.
    In the past, I was one of these developers myself. I liked to use Hibernate, but I also struggled with slow database queries and other performance issues. That changed over the years when I spend more and more time working with and teaching about Hibernate.
    When you analyze enough inefficient queries, you recognize that you just have to follow a few simple recommendations to avoid most of them.
    If you like this video, please give me your thumbs up and share it with your friends and co-workers.
    Like my channel? Subscribe!
    ➜ bit.ly/2cUsid8
    Join the free Member Library:
    goo.gl/dtyIIC
    Read the accompanying post: www.thoughts-on-java.org/5-ti...
    Want to connect with me?
    Blog: www.thoughts-on-java.org/
    Twitter: / thjanssen123
    Facebook: / thoughtsonjava
    #JPA #Hibernate #queries #performance tuning
  • Наука та технологія

КОМЕНТАРІ • 5

  • @santoshsharma3208
    @santoshsharma3208 3 роки тому +3

    Hi! your tutorials are great for beginners like me. Could you please explain the recursive json problem in many-to-many mapping, as well as complex filter queries in jpa hibernate that take on dynamic list as a parameter.

  • @7BlackJack8
    @7BlackJack8 6 років тому +2

    I think lots of people would be grateful to you, if u could extend the Entity Graph and Join Fetch with Criteria part of this video. Maybe with some use cases as usual. Pls do a dedicated video..This could help expecially because of the new 2.1 specs around.

    • @ThoughtsOnJava
      @ThoughtsOnJava  6 років тому +2

      Hi,
      Thanks for your comment.
      I explain EntityGraph and @NamedEntityGraph in more details in this video: ua-cam.com/video/Dr5Qn6NC-3Y/v-deo.html
      And I wrote about it in these posts:
      www.thoughts-on-java.org/2014/03/jpa-21-entity-graph-part-1-named-entity.html
      www.thoughts-on-java.org/2014/04/jpa-21-entity-graph-part-2-define.html
      Regards,
      Thorben

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

    thanks

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

    Hibernate is not properly populating the primary keys which are sequence generated if fetch type Eager isn't used. I am guessing the work around on this is to create the child entities first and then populate the relationships. There seems to be a lot of work arounds in hibernate. There is a ton of does and don'ts when working with hibernate, hell Thorben, you've made a living out of documenting them and giving classes on them. Why not just learn and use SQL and use JDBC to get all the data that is needed for each of the queries? That is my recommendation for the future.