Building the home page backend
Now, the frontend is ready. Let's implement the backend, which includes the following subtasks:
- Create API handlers in theÂ
com.taskagile.web.apis
package - Create application services in theÂ
com.taskagile.domain.application
package - Create models in theÂ
com.taskagile.domain.model
package - Create a repository implementation in theÂ
com.taskagile.infrastructure.repository
package
Domain models
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...