October 2018
Intermediate to advanced
590 pages
15h 5m
English
With ORM, there is a tendency to use the @OneToMany and @ManyToMany annotations to build the relationship between entities, and you can go from one entity to another easily. It does provide some convenience and reduces the amount of code.
Here, we are going to go with a different approach; we won't use these annotations to build the relationship. We will use a wrapper ID to build the relationship.
The following is how the com.taskagile.domain.model.team.Team model looks like. Some fields and methods are not listed here:
@Entity@Table(name = "team")public class Team extends AbstractBaseEntity { ... @Column(name = "userId") private long userId; ... /** * Create new team */ public static Team create(String name, UserId creatorId ...Read now
Unlock full access