Software Alternatives & Reviews

Using Value Objects as Aggregate Identifiers with Hibernate

Hibernate Flyway
  1. Hibernate an open source Java persistence framework project.
    Pricing:
    • Open Source
    This is perfectly possible to do with JPA and Hibernate, but requires some additional work as it goes against the design principles of JPA where you should not have to care about the IDs at all and just work with your entity objects directly. Let's have a look at how. We will be building on the code and principles laid out in my posts about value objects and aggregates so please read those first if you haven't already.

    #Web Frameworks #Developer Tools #Development 14 social mentions

  2. 2
    Flyway is a database migration tool.
    Pricing:
    • Open Source
    Phew! Now we can use CustomerId both to identify Customer aggregates and to refer to them from other aggregates. Please keep in mind, though, that if you let Hibernate generate your SQL schema for you and you use IDs to refer to aggregates instead of @ManyToOne associations, Hibernate will not create foreign key constraints. You will have to do that yourself, for example using Flyway.

    #MySQL Tools #Development #Online Services 57 social mentions

Discuss: Using Value Objects as Aggregate Identifiers with Hibernate

Log in or Post with