I'm familiar with typical layered architecture consisting of services, entities and repositories. Services manipulate annotated entity classes which are being persisted by repositories. In this model entity classes are just anemic data containers with bunch of getters and setters. The business logic resides in the procedural service classes (singletons managed by the spring container).
I'm learning DDD as a hobby project. In DDD entities forms a rich domain model which accommodates majority of the business logic at the aggregate root methods (and value objects). Services are almost mere coordinators of collaborating entities, repositories and other services. Rich domain model enforces business constraints and invariants the true OOP way and promotes the code maintainability. Also, the domain model is the core of the hexagonal architecture, meaning it's just POJOs not depending on technical or framework concerns at the source code level.
But JPA specification mandates the entity bean should have public getters and setters, inherently being an anemic data container, antithesis to the DDD domain model. So should I bundle domain logic inside the JPA entity? Or should I maintain two distinct models and the mapping logic when working with ORM on DDD? Where should these model and the mapping logic live at the project level?