Skip to content
Thorben Janssen
  • BlogExpand
    • Tutorials
    • Hibernate Tips
    • Video Tutorials
  • Persistence Hub
  • Workshops
  • Consulting
  • Book
  • AboutExpand
    • About
    • Talks
    • Contact
Sign In
Thorben Janssen

Primary Key

  • Hibernate Tips: How to Share the Primary Key in a One-to-One Association
    JPA | Hibernate Tips

    Hibernate Tips: How to Share the Primary Key in a One-to-One Association

    ByThorben Janssen

    Hibernate Tips is a series of posts in which I describe a quick and easy solution for common Hibernate questions. If you have a question for a future Hibernate Tip, please leave a comment below. Question: I need to map a one-to-one association in which the primary key value of one entity is also used…

    Read More Hibernate Tips: How to Share the Primary Key in a One-to-One AssociationContinue

  • Hibernate Tips: How to model an association that doesn’t reference primary key columns
    JPA | Hibernate Tips

    Hibernate Tips: How to model an association that doesn’t reference primary key columns

    ByThorben Janssen

    Hibernate Tips is a series of posts in which I describe a quick and easy solution for common Hibernate questions. If you have a question for a future Hibernate Tip, please leave a comment below. Question: I have to map a legacy table model with Hibernate. It contains a many-to-one association that uses a non-primary…

    Read More Hibernate Tips: How to model an association that doesn’t reference primary key columnsContinue

  • How to override the primary key generation strategy
    Hibernate Tips

    Hibernate Tips: How to override the primary key generation strategy

    ByThorben Janssen

    Hibernate Tips is a series of posts in which I describe a quick and easy solution for common Hibernate questions. If you have a question for a future Hibernate Tip, please leave a comment below. Question: You explained that the GenerationType.SEQUENCE is the most efficient primary key generation strategy and that MySQL doesn’t support it….

    Read More Hibernate Tips: How to override the primary key generation strategyContinue

  • Hibernate Tips: Use an auto-incremented column as primary key
    Hibernate Tips

    Hibernate Tips: Use an auto-incremented column as primary key

    ByThorben Janssen

    Hibernate Tips is a series of posts in which I describe a quick and easy solution for common Hibernate questions. If you have a question you like me to answer, please leave a comment below. Question: My database supports auto-incremented columns. How can I use them as primary keys in Hibernate?

    Read More Hibernate Tips: Use an auto-incremented column as primary keyContinue

  • @NaturalId – A good way to persist natural IDs with Hibernate?
    Hibernate Advanced

    @NaturalId – A good way to persist natural IDs with Hibernate?

    ByThorben Janssen

    In the real world, most objects have a natural identifier. Typical examples are the ISBN number of a book, a company’s tax identifier or a person’s social security number. You could, of course, use these identifiers as primary keys. But most often, it’s a better idea to generate numeric, surrogate keys. They are easier to…

    Read More @NaturalId – A good way to persist natural IDs with Hibernate?Continue

Page navigation

Previous PagePrevious 1 2 3 4 Next PageNext

Join the Newsletter

Join 10k+ subscribers to get a persistence tip every weekday.

I will collect, use and protect your data in accordance with my privacy policy.

Level up your skills!

  • In-depth courses
  • Expert sessions
  • Monthly persistence news
Learn more!
Twitter YouTube Github Facebook Xing Linkedin
  • Disclaimer
  • Privacy Policy
  • Terms of Service
  • Imprint
  • Contact
  • Change privacy settings
  • Privacy settings history
  • Revoke consents

© 2025 Thorben Janssen, all rights reserved.

  • Blog
    • Tutorials
    • Hibernate Tips
    • Video Tutorials
  • Persistence Hub
  • Workshops
  • Consulting
  • Book
  • About
    • About
    • Talks
    • Contact
Search