Vlad Mihalcea
Vlad Mihalcea
  • Видео 20
  • Просмотров 147 880
Tuning the JPA and Hibernate mappings of a Spring e-commerce application
This is the third episode of the series, in which we are fixing the JPA and Hibernate mapping issues reported by Hypersistence Optimizer when analyzing the Shopizer OSS project.
If you haven't watched the first and the second episodes, you may want to start with those:
• ruclips.net/video/Z4FsIMksTBk/видео.html
• ruclips.net/video/gx5pi-wKrcA/видео.html
The GitHub repository used in this video can be located here:
github.com/vladmihalcea/shopizer
And the Hypersistence Optimizer tool we are using can be found here:
vladmihalcea.com/hypersistence-optimizer/
Просмотров: 2 491

Видео

Tuning the JPA and Hibernate configurations of a Spring e-commerce application
Просмотров 1,5 тыс.Год назад
This is the second episode of the series, in which we are fixing the JPA and Hibernate configuration issues reported by Hypersistence Optimizer when analyzing the Shopizer OSS project. If you haven't watched the first episode, you may want to start with that one 👇: ruclips.net/video/Z4FsIMksTBk/видео.html And afterward, you can watch the next part in which we are going to fix the JPA and Hibern...
Tuning a Spring e-commerce application using Hypersistence Optimizer
Просмотров 4 тыс.Год назад
1️⃣ This is the first episode of the series, in which we are investigating the performance tuning issues reported by Hypersistence Optimizer when analyzing the Shopizer OSS project. The GitHub repository used in this video can be located here: github.com/vladmihalcea/shopizer And the Hypersistence Optimizer tool we are using can be found here: vladmihalcea.com/hypersistence-optimizer/ 2️⃣ If yo...
The best way to map the JPA and Hibernate ManyToMany relationship
Просмотров 7 тыс.Год назад
In this video episode, I’m going to show you the best way to map a ManyToMany association when using JPA and Hibernate. As simple as JPA annotations might be, it’s not always obvious how efficient they are behind the scenes.
The best way to fetch entities with JPA and Hibernate
Просмотров 3,3 тыс.Год назад
In this video, we are going to talk about fetching JPA and Hibernate entities. First, I'm going to explain how you fetch entities directly via their entity identifier or natural identifier. Afterward, we are going to see how we can fetch entities via JPQL, SQL, and Criteria API queries. In the end, I'm going to explain how the JPA entity Metamodel works and why you should use it when building d...
The best way to fetch SQL query projections with JPA
Просмотров 4,2 тыс.Год назад
Learn what the best way you can fetch SQL query projections when using JPA. In this video, you are going to learn: 1️⃣ How the default Object[] query projection works 2️⃣ How to use the JPA Tuple for query projections 3️⃣ How to fetch DTO projections using JPA 4️⃣ How to use Java Records with JPA query projections
The best way to map a @OneToOne relationship with JPA and Hibernate
Просмотров 9 тыс.Год назад
In this video, we are going to learn the best way to map a @OneToOne association with JPA and Hibernate. While there are many ways you can map a one-to-one relationship with Hibernate, I’m going to demonstrate which mapping is the most efficient one from a database perspective.
How to use the SQL EXISTS and NOT EXISTS conditional operators
Просмотров 16 тыс.2 года назад
In this video, we are going to see how the SQL EXISTS and NOT EXISTS operators work and when you should use them. Although these operators have been available since SQL:86, the very first edition of the SQL Standard, I found that there are still many application developers who don’t realize how powerful SQL subquery expressions really are when it comes to filtering a given table based on a cond...
How do SQL Recursive CTE queries work
Просмотров 4,4 тыс.2 года назад
In this video, you are going to learn how SQL Recursive CTE queries work. This video is part of my HIgh-Performance SQL video course, so if you liked this video, you are going to love my video course. vladmihalcea.com/courses/high-performance-sql/
Spring Boot Performance Workshop with Lightrun
Просмотров 8 тыс.2 года назад
In this workshop, you will learn how to identify the cause of various Spring Boot performance issues on a live production system using Lightrun. Lightrun is a developer-centric observability platform that allows you to add logs and metrics, as well as capture snapshots in real-time and on-demand, without having to redeploy your production system. Check out the following link if you'd like to gi...
The best way to map a bidirectional JPA OneToMany relationship
Просмотров 16 тыс.3 года назад
Learn how to map a bidirectional JPA OneToMany relationship using the ManyToOne and OneToMany annotations.
How does the JDBC Statement Fetch Size work
Просмотров 2,9 тыс.4 года назад
Learn how the JDBC Statement Fetch Size works and what's the best value to use by default depending on the underlying database system (e.g., Oracle, SQL Server, PostgreSQL or MySQL).
How to speed up database integration tests using Docker and tmpfs
Просмотров 2,5 тыс.4 года назад
In this video, I'm going to demonstrate how you can speed up database integration tests using Docker and tmpfs. By using this strategy, you will be able to run MySQL or PostgreSQL integration tests almost as fast as when using an in-memory database, like H2 or HSQLDB. This video is a sample of my High-Performance Java Persistence video course. So, if you like it, you are going to love the entir...
How to write Criteria API queries using Codota
Просмотров 3,6 тыс.5 лет назад
Codota is a code completion Java IDE tool that uses Artificial Intelligence to provide suggestions based on the most common ways of using a certain API. In this episode, we are going to see how we can use Codota to simplify the process of writing JPA Criteria API queries. You can get Codota (which is free, by the way) here: vladmihalcea.com/try-codota This research was funded by Codota and cond...
Tuning Spring PetClinic JPA and Hibernate configuration with Hypersistence Optimizer
Просмотров 19 тыс.5 лет назад
In this video, we are going to see how we can tune the performance of the Spring PetClinic application using Hypersistence Optimizer. Now, while you can manually analyze your data access layer to make sure that JPA and Hibernate are properly configured, it’s much better if you can automate this task. That’s because new entities might be mapped in the future, and you want to make sure that the s...
The best way to batch insert, update, and delete statements with JPA and Hibernate
Просмотров 21 тыс.5 лет назад
The best way to batch insert, update, and delete statements with JPA and Hibernate
Why you should use my high-performance-java-persistence GitHub repository
Просмотров 6 тыс.6 лет назад
Why you should use my high-performance-java-persistence GitHub repository
How to integrate a GitHub Pull Request using interactive rebase and squashing commits
Просмотров 2,2 тыс.6 лет назад
How to integrate a GitHub Pull Request using interactive rebase and squashing commits
What is the Lost Update anomaly and the best way to fix it
Просмотров 3,4 тыс.6 лет назад
What is the Lost Update anomaly and the best way to fix it
The best way to log SQL statements with JPA and Hibernate
Просмотров 13 тыс.7 лет назад
The best way to log SQL statements with JPA and Hibernate

Комментарии

  • @BrianaSullivan-p7b
    @BrianaSullivan-p7b 2 дня назад

    Lopez Paul Davis Ronald Thomas Sandra

  • @howto...6298
    @howto...6298 7 дней назад

    i think they removed hypersistence-optimizer library in the latest version. [EDIT]: moved*

    • @vladmihalcea
      @vladmihalcea 7 дней назад

      What do you mean? Who are they? And what was moved?

    • @howto...6298
      @howto...6298 7 дней назад

      @@vladmihalcea well when i try adding the dependency in my pom it didnt work the artifactId "hypersistence-optimizer" wasn't available but instead i found "hypersistence-utils-hibernate-60" in maven so when i try with this it was not there. So i thought it migh be moved to someplace else in the utils...i think i need to look around more And i think they is you😅

    • @vladmihalcea
      @vladmihalcea 7 дней назад

      @@howto...6298 The project is not open source, so it's not on Maven Central. You have to install it from the package you downloaded from Teachable, following the links from my website.

  • @Devivl
    @Devivl 22 дня назад

    Great video, Vlad. Thank you very much.

    • @vladmihalcea
      @vladmihalcea 22 дня назад

      I'm glad you liked it. This video is part of my High-Performance Java Persistence video course, so if you liked this video, you are going to love the video course. vladmihalcea.com/courses/high-performance-java-persistence/

    • @Devivl
      @Devivl 21 день назад

      ​@@vladmihalcea I am convinced that your course is flawless and will provide invaluable experience for students, beginners and experienced staff. Thank you for sharing your expertise. The future lies with smart and kind people. You're part of the future, Vlad.

  • @kerbar9262
    @kerbar9262 27 дней назад

    Hello , Mr Vlad Thanks so munch for this amazing video , thanks to you I have improved performance and my applications are faster

    • @vladmihalcea
      @vladmihalcea 26 дней назад

      You're welcome. I'm glad I could help.

  • @java_tar
    @java_tar 28 дней назад

    hello there thanks for this amazing video i wanted to ask can i have a projection with postDTO and in it a list of PostCmmecntsDto and if so what is the jpql query to return will be like ?

    • @vladmihalcea
      @vladmihalcea 28 дней назад

      Yes, you can. Check out this article for more details: vladmihalcea.com/one-to-many-dto-projection-hibernate/ If you prefer a video explanation, then check out my video course as well: vladmihalceastore.teachable.com/p/high-performance-java-persistence-online

    • @java_tar
      @java_tar 28 дней назад

      @@vladmihalcea very nice article i got it now thank you so much

  • @dineshshekhawat2021
    @dineshshekhawat2021 Месяц назад

    Best explanation I've ever seen. Thank You for explaining this. Your video deserves a million views

    • @vladmihalcea
      @vladmihalcea Месяц назад

      You're welcome. This video is an episode of my High-Performance Java Persistence video course. If you liked the video, you are going to love the 11-hour video course vladmihalcea.com/courses/high-performance-java-persistence/

  • @Jp-bb4cv
    @Jp-bb4cv 4 месяца назад

    very good lecture, many tks!

    • @vladmihalcea
      @vladmihalcea 4 месяца назад

      You're welcome. If you liked this snippet, you are going to love the video course where this snippet is coming from: vladmihalcea.com/courses/high-performance-java-persistence/

  • @cicartaya
    @cicartaya 4 месяца назад

    5:40 How are you gonna have your stupid face cover up a box we're supposed to read and a link to a video covering up the student_grade table that we need to look at? I was trying really hard to understand your explanation, but this really pissed me off that I wasted 6 minutes of my life on your stupid video. Terrible

  • @micha6568
    @micha6568 7 месяцев назад

    Great video. Vlad, thanks for many tutorials, your jpa skills are amazing!

    • @vladmihalcea
      @vladmihalcea 7 месяцев назад

      Thanks and stay tuned for more

  • @gssj-o8p
    @gssj-o8p 9 месяцев назад

    Nice explanation!

    • @vladmihalcea
      @vladmihalcea 9 месяцев назад

      Thanks. This video is a lesson from my HIgh-Performance SQL video course, so if you liked it, you are going to love the video course. vladmihalceastore.teachable.com/p/high-performance-sql-online?coupon_code=BLACKFRIDAY23

  • @gudguy1a
    @gudguy1a 10 месяцев назад

    Good job, thanks for posting to clarify it better for us. But, if you don't mind, this is for 10th grade delineation. And not having a grade score of 10 (and if you meant 10th grade, apologies in advance). Never mind, I see later on that you 'are' talking grades of 10, 9, 8, etc...

    • @vladmihalcea
      @vladmihalcea 10 месяцев назад

      In Europe, where I live, many countries use the 0-10 grade system, where 10 is the highest score. www.nuffic.nl/en/education-systems/european-baccalaureate/grades-and-study-results Hence, the example in this video.

  • @fusing17
    @fusing17 10 месяцев назад

    brilliant! can't wait for more videos on this series

  • @Exterminator131
    @Exterminator131 10 месяцев назад

    In my opinion, it's much simpler to just keep all three tables as the ones without any *ToMany relations and do all the stuff by hand. Looking at the complexity of the utility methods, as well as mapping verbosity of the entities, it will be easier to do all the activities in the code directly (better to read, better to modify and support). For example, if we need to add a new many-to-many relation, we just persist manually all two parents and then add a new entity representing many-to-many relation. The same is about removal - just remove the desired record(s) from the join table, and then delete the parent ones!

    • @vladmihalcea
      @vladmihalcea 10 месяцев назад

      You can map the intermediary table as an entity and get both the convenience of the entity relationship and the flexibility of adding new columns and get the same performance of doing the operations manually.

    • @Exterminator131
      @Exterminator131 10 месяцев назад

      @@vladmihalcea Thanks for your reply. I don't have the finite opinion on that, but anyways... I'm not sure, that auxiliary table will address complexity issues here... I may be wrong, but it seems simpler to just create two parent entities without any *ToMany relations inside, and the one entity representing join table with one-to-one relation on these parents. In my view, add/remove of both parents and relations between them should be much easier in this regard, as well as understanding of the code. Of course, not everything is cloudless with such an approach. For instance, I'm predicting a lot of troubles with further conversion of the retrieved entities into DTO/JSON to propagate it further as a REST API response: if we had *ToMany parent-child entity, it will be converted into one JSON automatically keeping "children" field as an array of relations. But in case of separate entities, you should do extra activities to compile different entity objects into one DTO/JSON.

    • @vladmihalcea
      @vladmihalcea 10 месяцев назад

      @@Exterminator131 You don't need to convert entities to DTOs. You can simply extract Hierarchical DTOs directly from the DB, as I explained in this article vladmihalcea.com/one-to-many-dto-projection-hibernate/ Fetching entities only to discard what you don't need and create a DTO is wasteful. If you think that avoiding the collections is easier for you, then you should not map the associations. In the end, any collection can be replaced with a query.

  • @Nominal_GDP
    @Nominal_GDP 11 месяцев назад

    nice video length!

  • @teddyfabriciocordovasaenz3018
    @teddyfabriciocordovasaenz3018 11 месяцев назад

    Great explanation Sir.

    • @vladmihalcea
      @vladmihalcea 11 месяцев назад

      You're welcome. If you liked this episode, you are going to love my High-Performance SQL video course.

  • @niladrisekharnath
    @niladrisekharnath 11 месяцев назад

    Thanks for the most of the approaches demonstration but can you please tell me something for the result set we know what would be the value that we are selecting and we keep one DTO for the resultList for the values that would be coming to us, but what if we don't know what are the values that we are selecting(like we know that the fields are part of some Entity class) but we don't know what are the values that would be requested for us like sometimes five values are requested and sometimes 10 values so what should we do then ? Obviously we cannot create a ResultDTO for the values for every combination, then please suggest how to create a DTO for the resultSet for the values that would do something like when five fields are selected we set the five values and rest of the fields we set as null ? What would be the efficient way to do this ?

    • @vladmihalcea
      @vladmihalcea 11 месяцев назад

      You can create a different DTO for each specific use case. If you have 5 different use,cases, you create 5 DTOs. Or, you can use the Spring Data JPA interface-based projection and avoid creating the DTO classes.

  • @Abhishekchandel008
    @Abhishekchandel008 Год назад

    What do you recommend, if there are multiple many to many relationship in the same join table?

    • @vladmihalcea
      @vladmihalcea Год назад

      I don't see how the same join table could ever be used to store multiple FK sets for different parent sets.

    • @Abhishekchandel008
      @Abhishekchandel008 Год назад

      Hi @vladmihalcea , Thank you for the prompt reply. Let's say I am storing roles for a tenant and the associated user. so my join table will have user_id, role_id and tenant_id and some extra colums. My question was, can we apply the same logic as suggested in the video in this case too?

    • @Abhishekchandel008
      @Abhishekchandel008 Год назад

      I am using the same mapping as suggested in the video, for my case as well, just wanted to know if there are better ways than this.

    • @vladmihalcea
      @vladmihalcea Год назад

      @@Abhishekchandel008 Your join table can have extra columns and extra associations. Check out my High-Performance Java Persistence video course for more details: vladmihalcea.teachable.com/p/high-performance-java-persistence-mach-3-online

    • @vladmihalcea
      @vladmihalcea Год назад

      @@Abhishekchandel008 There's always a better way. However, that requires analyzing your schema and the business requirements. Luckily, I do offer consulting if your company is interested in improving their codebase.

  • @baibula
    @baibula Год назад

    I'm receiving the error message 'sqlExceptionHelper - table 'post' does not exist, skipping,' along with a batch of similar logs. What could be the issue? This code runs in testcontainers. Do I need to manually adjust the debug log level or something?

    • @vladmihalcea
      @vladmihalcea Год назад

      When the DB schema is built, it first tries to drop the tables. If there is no such table, the DROP will not work, but the failure is skipped since it's not an issue. As long as the tests run, everything runs as expected.

    • @baibula
      @baibula Год назад

      Cool, so I just need to adjust the logs to debug.

  • @lucasv4q
    @lucasv4q Год назад

    thanks for sharing ur knowledge. Really usefull to understand how those things work under the hood

    • @vladmihalcea
      @vladmihalcea Год назад

      I'm glad you liked it and stay tuned for more

  • @romarioputra3775
    @romarioputra3775 Год назад

    What is batch job? Can we replace the batch job "actor" With a second/multiple user such as Bob?

    • @romarioputra3775
      @romarioputra3775 Год назад

      What happen if there are 2 READ/SELECT transactions happen at the same times?

    • @vladmihalcea
      @vladmihalcea Год назад

      The second transaction can be anything.

    • @romarioputra3775
      @romarioputra3775 Год назад

      @@vladmihalcea sorry, i need to ask you. On that article, you said pessimistic/serializable does not solve Lost Update problem, could you explain it further?

    • @vladmihalcea
      @vladmihalcea Год назад

      @@romarioputra3775 You can find a more detailed explanation in the Transaction module of my High-Performance Java Persistence video course vladmihalcea.teachable.com/p/high-performance-java-persistence-mach-3-online

  • @user-ok1ux7gg5c
    @user-ok1ux7gg5c Год назад

    Could you please elaborate on the cases where it is better to map the Join Table in a separate JPA Entity? Thanks in advance

    • @vladmihalcea
      @vladmihalcea Год назад

      You can find a detailed explanation of your question in my High-Performance Java Persistence video course. Enjoy watching almost 11 hours of video lessons: vladmihalcea.teachable.com/p/high-performance-java-persistence-mach-3-online

  • @TheSemenFarada
    @TheSemenFarada Год назад

    Why not make a Post as a relation owner?

  • @user-cr5kz9nb5d
    @user-cr5kz9nb5d Год назад

    Thank you for video! I have a question, can i create DTO projection if my entity have nested collections?

    • @vladmihalcea
      @vladmihalcea Год назад

      Yes, of course. Check out this article for more details vladmihalcea.com/one-to-many-dto-projection-hibernate/

    • @user-cr5kz9nb5d
      @user-cr5kz9nb5d Год назад

      @@vladmihalcea thank you very much.

    • @user-cr5kz9nb5d
      @user-cr5kz9nb5d Год назад

      @@vladmihalcea If I have 5 collections in entity, and that collections have nested collections, than I want to fetch all that fields. Can you help to find answer for that? Thank you.

    • @vladmihalcea
      @vladmihalcea Год назад

      @@user-cr5kz9nb5d You can do it like this github.com/vladmihalcea/high-performance-java-persistence/blob/master/core/src/test/java/com/vladmihalcea/book/hpjp/hibernate/fetching/multiple/MultiLevelCollectionFetchingTest.java#L108

  • @phuphan2513
    @phuphan2513 Год назад

    Hi Vlad, thanks for your video. May I have several questions as below: 1. why when the first statement "select 0,0" executed, then these 0,0 sent to i, and consecutive_sum? while the whole statements within "With" haven't finished yet? 2. IN the second statment i.e. recursive statement "select i + 1, i + 1 + consecutive_sum from consecutive_sum_number" And when i + 1, i+1 + consecutive_sum will be sent to i, and consecutive_sum again for the next iteration? In short, it doesn't look like a native recursive isn't it? cause it doesn't seem to be function call same function, so everytime when consecutive_sum is call then within this function we have select 0,0, union with something. it quite confused me. Thank you

    • @vladmihalcea
      @vladmihalcea Год назад

      SQL is a declarative language. You're analyzing the query definition using a procedural mindset. That's why it confused you. What you need to do is run EXPLAIN ANALYZE on the query and see exactly the stream operations done by the DB when executing the query.

    • @phuphan2513
      @phuphan2513 Год назад

      @@vladmihalcea Thanks Vlad, will try to explore more. anyway subcribed to your channel to see more useful contents.

  • @GonzaloMendozaa1993
    @GonzaloMendozaa1993 Год назад

    Excelent video, it was so helpful. Thanks!

  • @kshitizkumar6258
    @kshitizkumar6258 Год назад

    Video sound is low. Btw good explanation.

    • @vladmihalcea
      @vladmihalcea Год назад

      On my latest videos, I increased the volume.

  • @maksadnahibhoolna-wc2ef
    @maksadnahibhoolna-wc2ef Год назад

    Hope you continue similar fine tuning videos, gives a lot of information to grasp

    • @vladmihalcea
      @vladmihalcea Год назад

      I'm glad you liked it

    • @Jody-nf2bz
      @Jody-nf2bz Год назад

      @@vladmihalcea Your videos are excellent, well explained with high quality image, etc. But if they all have the same title, how do I know the order? For example: Part 1, Part 2, etc? Thank you.

    • @vladmihalcea
      @vladmihalcea Год назад

      @@Jody-nf2bz In the description of every video, you will find information about the previous and next videos in the series. However, you can watch them in any order as each one is dedicated to a specific topic.

    • @Jody-nf2bz
      @Jody-nf2bz Год назад

      @@vladmihalcea Thank you.

    • @vladmihalcea
      @vladmihalcea Год назад

      @@Jody-nf2bz You're welcome. Enjoy watching them!

  • @Scorpion_13131
    @Scorpion_13131 Год назад

    Great explanation! Thank you

  • @vagnerdasilva1652
    @vagnerdasilva1652 Год назад

    In Windows 10 is there a way to create tmpfs?

    • @vladmihalcea
      @vladmihalcea Год назад

      It's easier if you use Docker to run the DB on tmpfs. This works no matter what host OS you use. vladmihalcea.com/how-to-run-integration-tests-at-warp-speed-with-docker-and-tmpfs/

    • @vagnerdasilva1652
      @vagnerdasilva1652 Год назад

      @@vladmihalcea Got it, another question on the android phone is there any app for me to create tmpfs or ramfs?

    • @vladmihalcea
      @vladmihalcea Год назад

      @@vagnerdasilva1652 For SQLite on Android?

    • @vagnerdasilva1652
      @vagnerdasilva1652 Год назад

      @@vladmihalcea Is this SQLite the name of the application that you said you have in the Play Store?

    • @vladmihalcea
      @vladmihalcea Год назад

      @@vagnerdasilva1652 I didn't say anything about Play Store. It's unlikely that you need tmpfs for Android.

  • @brfb
    @brfb Год назад

    Love what you do! :) Thanks for these videos.

  • @anaslolozi4187
    @anaslolozi4187 Год назад

    Very informative video .. Thanks a lot Vlad

  • @MrMoralHazard
    @MrMoralHazard Год назад

    Looking forward to the series!

    • @vladmihalcea
      @vladmihalcea Год назад

      Prepare yourself to be amazed 🚀

  • @ImMouldyJim
    @ImMouldyJim Год назад

    Thanks!

  • @chetan4055
    @chetan4055 Год назад

    You are true champion 🏆

  • @melancholy-engineering
    @melancholy-engineering Год назад

    Thanks for the great video, as always. Could you please share what visualization tool you are using at 0:45?

    • @vladmihalcea
      @vladmihalcea Год назад

      The class diagrams were generated with IntelliJ IDEA. The DB table diagrams with MySQL Browser. The rest of the diagrams were generated with yEd.

  • @vaheharutyunyan966
    @vaheharutyunyan966 Год назад

    As always very good Video Vlad, Thank you.

    • @vladmihalcea
      @vladmihalcea Год назад

      You're welcome and stay tuned for more

  • @vaheharutyunyan966
    @vaheharutyunyan966 Год назад

    I find JPA Query DSL lib much much better than Criteria API, I don't know why people use Criteria API. What do you think about Query DSL Vlad ?

    • @vladmihalcea
      @vladmihalcea Год назад

      I use Blaze Persistence instead of Criteria API: vladmihalcea.com/blaze-persistence-jpa-criteria-queries/ QueryDSL was abandoned for many years, and only currently got some updates. For native SQL, I'd rather use jOOQ, as it's superior to QueryDSL in any way.

    • @vaheharutyunyan966
      @vaheharutyunyan966 Год назад

      @@vladmihalcea It seams Blaze does not give TypeSafe queries like QueryDSL, what is other disadvantage of QueryDSL beside not being maintained actively ?

    • @vladmihalcea
      @vladmihalcea Год назад

      @@vaheharutyunyan966 Blaze Persistence has typed queries using the JPA Metamodel vladmihalcea.com/bulk-update-delete-blaze-persistence/ However, jOOQ is even more powerful than Blaze. You can even use it to fetch efficiently multiple one-to-many relations without a Cartesian Product: blog.jooq.org/jooq-3-15s-new-multiset-operator-will-change-how-you-think-about-sql/ It's also amazing for stored procedures too: vladmihalcea.com/jooq-facts-sql-functions-made-easy/ Plus, it offers Keyset Pagination, Recursive CTE, Pivot, Window Functions, Lateral Joins, JSON, and many more features. And it's maintained and improved constantly.

  • @yvip
    @yvip Год назад

    Thank you very good info

  • @aleemkhowaja2274
    @aleemkhowaja2274 Год назад

    How can we achieve this feature in spring data jpa?

    • @vladmihalcea
      @vladmihalcea Год назад

      Which feature are you talking about?

    • @aleemkhowaja2274
      @aleemkhowaja2274 Год назад

      @@vladmihalcea I mean one to one relationship without n+1 problem which you described in video

    • @vladmihalcea
      @vladmihalcea Год назад

      @@aleemkhowaja2274 The solution for that can be done with a Maven or Gradle plugin that it's independent of Spring. So, it works I the same way with Spring as it does with Java EE.

    • @aleemkhowaja2274
      @aleemkhowaja2274 Год назад

      @@vladmihalcea ahh ok yaah makes sense to me thanks bro btw great explanation in video and thank you so much for response cheers 🥂 🙂

    • @vladmihalcea
      @vladmihalcea Год назад

      @@aleemkhowaja2274 You're welcome. If you liked this video, there's a 40% discount on the video course: vladmihalcea.teachable.com/p/high-performance-java-persistence-mach-3-online/?coupon_code=BLACKFRIDAY22 But hurry up! It expires in 2 days.

  • @wojtek120pl
    @wojtek120pl Год назад

    Great video! Now, I'm thinking about whole course :) please, tell me why children entity should be owning side of relation?

    • @vladmihalcea
      @vladmihalcea Год назад

      I'm glad you liked it. In fact, you are going to love the video course even more. As for your question, the entity that maps the FK column is the one that should own the relation because FK column values are supposed to be managed via their associated table record.

  • @maiers72
    @maiers72 Год назад

    Thank you for all the information. Do you have some more information when to use which approach?

    • @vladmihalcea
      @vladmihalcea Год назад

      Thanks. I'm glad you liked it. You can find more information about the topic and details about when to use one strategy or the other in my High-Performance Java Persistence video course. vladmihalcea.com/courses/high-performance-java-persistence/ It features 11 hours of video lessons that you are going to love even more than this sample.

  • @bassamalharbi7108
    @bassamalharbi7108 Год назад

    👍🏻

  • @swannhs
    @swannhs Год назад

    Please continue 🙏😍

    • @vladmihalcea
      @vladmihalcea Год назад

      I will. Subscribe to get the update.

    • @swannhs
      @swannhs Год назад

      Thank you so much sir ❤️

  • @jkickic
    @jkickic Год назад

    These approaches are much better than handling Object[] data but still look kind of complicated. Why can't I just supply a random object with fields annotaded such that the framework code can figure out how to assign results to the fields. Like (annotations made up, example simplified): @MappableResult public class PostDTO { @ResultMapping(name = "id") Long id; @ResultMapping(name = "title") String title; } Hibernate already does this with entities and @Column annotations, why not use a similar thing here? Would this break some core principles of the framework?

    • @vladmihalcea
      @vladmihalcea Год назад

      Actually, you can do that using Blaze Persistence. persistence.blazebit.com/documentation/1.5/entity-view/manual/en_US/#basic-mappings It's OSS and extremely powerful. It's like a JPA plugin that provides additional features.

    • @jkickic
      @jkickic Год назад

      @@vladmihalcea Oh that's good to know, I'll try this out :) Thanks

    • @vladmihalcea
      @vladmihalcea Год назад

      @@jkickic It's a really useful framework. I'm using it to write advanced Criteria queries that are way more readable than the default Criteria API. vladmihalcea.com/blaze-persistence-jpa-criteria-queries/ And you can also use it for Keyset Pagination with Spring Data JPA: vladmihalcea.com/keyset-pagination-spring/

  • @hacktipstricks
    @hacktipstricks Год назад

    Very Informative

  • @ConiCalaro
    @ConiCalaro Год назад

    Awesome video and direct explanation, thanks from Brazil

    • @vladmihalcea
      @vladmihalcea Год назад

      Thanks. I'm glad you liked it. This is part of my High-Performace SQL video course, so if you liked it, you are going to love the entire course. vladmihalcea.com/courses/high-performance-sql/

  • @fahmydiab
    @fahmydiab Год назад

    why do i need to have a one to one relationship? I mean i can wrap the details or include it in the post table

    • @vladmihalcea
      @vladmihalcea Год назад

      That's a very good question that I frequently get during my training. The @OneToOne relationship basically maps the one-to-one table relationship that was designed 40 years ago and which serves plenty of use cases, like the following ones: - if you have a JSON column that's large, you might not want to fit it on the same page as the original record as that could create page splits, increase the volume of data that gets synced to the disk when the pages get dirty - if you have columns that have different change frequencies, you can split them by write access patterns so that you could have the columns that frequently change in a separate table whose pages get synced often, but they leave the other table pages to reside in the Buffer Pool - to implement the JOINED table inheritance strategy - to split a large table into multiple ones to increase write scalability as UPDATEs and DELETEs take locks at record level in relational databases, and once you change a single column, the entire record gets locked until you commit or roll back. But by splitting the original table into several tables, you can increase the write throughput. - to reduce the optimistic locking conflicts as you have multiple version columns in multiple tables. If you only have a single table, then any column change will cause the other concurrent transactions that also want to change the same record to abort after the first transaction has bumped the version up.

  • @jalilhasanli5577
    @jalilhasanli5577 Год назад

    Today I have heard about you from my colleague, and I fell in love with your articles and now I am very glad to see you here. Thanks in advance))

  • @piotrwojcik1400
    @piotrwojcik1400 Год назад

    Awesome content as always, keep up the good work!

    • @vladmihalcea
      @vladmihalcea Год назад

      Thanks, Piotr. Stay tuned for more!

  • @brijeshgpt7
    @brijeshgpt7 Год назад

    awesomeeeeee