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 Tip: How does Hibernate’s native ID generator work
    Hibernate Tips

    Hibernate Tip: How does Hibernate’s native ID generator work

    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 post a comment below. Question: One of the readers of my article about using Hibernate with a MySQL database asked the following question: What is…

    Read More Hibernate Tip: How does Hibernate’s native ID generator workContinue

  • Hibernate Tip: How to lazily load one-to-one associations
    Hibernate Tips

    Hibernate Tip: How to lazily load one-to-one associations

    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 post a comment below. Question: I modeled a one-to-one association and activated lazy loading for it. But it doesn’t work. How do I tell…

    Read More Hibernate Tip: How to lazily load one-to-one associationsContinue

  • 5 Primary Key Mappings for JPA and Hibernate Every Developer Should Know
    Hibernate Advanced

    5 Primary Key Mappings for JPA and Hibernate Every Developer Should Know

    ByThorben Janssen

    Mapping a primary key column with JPA and Hibernate is simple. You just need to add an attribute to your entity, make sure that its type and name match the database column, annotate it with @Column and you’re done. You can then use the primary key to load the entity, and Hibernate sets the primary…

    Read More 5 Primary Key Mappings for JPA and Hibernate Every Developer Should KnowContinue

  • Ultimate Guide to Implementing equals() and hashCode() with Hibernate
    Hibernate Advanced | JPA

    Ultimate Guide to Implementing equals() and hashCode() with Hibernate

    ByThorben Janssen

    The implementation of the equals() and hashCode() methods for entity classes is an often discussed question. Do you really need them? There are lots of applications that work perfectly fine using Java’s default methods provided by the Object class. And if you need to implement them, how should you do that? Should you use all attributes…

    Read More Ultimate Guide to Implementing equals() and hashCode() with HibernateContinue

  • How to Implement a Custom, Sequence-Based ID Generator
    Hibernate Advanced

    How to Implement a Custom, Sequence-Based ID Generator

    ByThorben Janssen

    A lot of applications use primary keys that are based on a sequence but use an additional prefix that contains semantic information. Here are some typical examples: A fixed String as a prefix followed by a sequence-based value of fixed or variable length, e.g., B_00001 or B_1 Year and month as a prefix followed by…

    Read More How to Implement a Custom, Sequence-Based ID GeneratorContinue

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