Getting the Most from JPA with Kotlin

Поділитися
Вставка
  • Опубліковано 7 січ 2025

КОМЕНТАРІ • 18

  • @markoziza7537
    @markoziza7537 3 роки тому +11

    A year ago I decided to try Kotlin and Spring Data JPA. How I wish this video was made avaliable sooner. Would have saved me hours of google time.

  • @valmirknasel
    @valmirknasel 3 роки тому +7

    JPA Buddy it's awesome!

  • @theLoneCodesman
    @theLoneCodesman 3 роки тому +2

    Immensely useful information here. Thanks a lot guys!

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

    Очень полезное видео, спасибо!:)

  • @rsobies
    @rsobies 3 роки тому +1

    exelent video, i wasn't aware of those cases at all

  • @Segun_OS
    @Segun_OS 3 роки тому +1

    New to Kotlin. Slowly understanding Kotlin for server side 🙏🏽

  • @AlanDarkworld
    @AlanDarkworld 3 роки тому +7

    Instead of using a constant value for a hash code (which completely forfeits any performance advantage of HashSet and HashMap), you can use a UUID as an ID which is generated in the constructor, instead of a database-assigned ID. Also, this avoids the problem that all entities of the same class will be equal(...) to one another (!!) until they are saved to the database for the first time.

    • @Kotlin
      @Kotlin  3 роки тому

      Thank you!

    • @theLoneCodesman
      @theLoneCodesman 3 роки тому

      Thanks. But are you suggesting that UUID should be saved as a primary key in DB or some arbitrary column or even don’t get persisted at all?

    • @AlanDarkworld
      @AlanDarkworld 3 роки тому

      @@theLoneCodesman the UUID can be used as primary key in a database. There are some major advantages, but also some drawbacks. There are many layers to this topic.

    • @theLoneCodesman
      @theLoneCodesman 3 роки тому

      @@AlanDarkworld I’m going to google it up. Thanks for pointing it out

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

    Could you mention a case where an entity should be stored in a collection before persisting? Is it reasonable to prohibit non-persisted entities' usage in such cases?

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

    Thanks

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

    🙌😀

  • @x__dos
    @x__dos 3 роки тому

    just dont put entitties to hasmap