Skip to main content
ElastiCORE 3.0 is a release candidate: 3.0.261022-rc1 on Maven Central. Projects on the 2.2 line: see the 2.2 documentation.
Version: 3.0

Layered

The layered reading generates the classic Spring Boot layers: entity, DTO, mapper, repository, XxxCoreService + XxxService, controller - for every entity marked @expose (or @service without a controller).

BundleWhen
jpa-springbootarchitecture = 'layered', Java - the same output as 2.x (apart from the 2.x bug fixes the history lists), checked on every pull request
jpa-springboot-v3the same with -Pv3: only the imports in use, class annotations written by rules, access checks, the write-path checks and problem+json answers of the v3 bundles
jpa-springboot-ktlanguage = 'kotlin'

Package layout​

The reference project elasticore-template names every package in its env.yml:

blueprint/content/env.yml (elasticore-template)
  namespace:
entity: io.elasticore.blueprint.domain.content.entity
dto: io.elasticore.blueprint.domain.content.dto
enumeration: io.elasticore.blueprint.domain.content.enums
repository: io.elasticore.blueprint.domain.content.repository
service: io.elasticore.blueprint.domain.content.service
control: io.elasticore.blueprint.domain.content.controller
port: io.elasticore.blueprint.domain.content.port
entity/      JPA entity + Q class (Specification metadata)
dto/ DTO, KeyDTO, SrchDTO, Mapper
repository/ Spring Data JPA repository
service/ CoreService (managed) + Service (yours)
controller/ REST controller
enums/ enum classes

What the 2.x-compatible output does not do​

jpa-springboot keeps the 2.x output, so the 3.0 domain rules are not in it: @access, @owner and @password are not enforced - the generator warns ... which the selected rules do not enforce - and states:, @compute and @snapshot are not generated. Kotlin's jpa-springboot-kt enforces @access, @owner and @password, not states:, @compute or @snapshot. For those, use DDD or hexagonal.

When to choose it​

  • A 2.x project upgraded to 3.0 that wants the rule engine with the output it already has.
  • Plain CRUD where aggregates, sealed roots and ports add nothing.

Samples​

  • elasticore-template - the 2.x reference project; its generated sources are the golden files of the compatibility checks.
  • elasticore-template-kt - Kotlin, language = 'kotlin'; most of its domains combine jpa-springboot-kt with DDD rules in env.yml (rules: [jpa-springboot-kt, ddd-aggregate, ddd-reference, ddd-value-object-kt]), its shop domain uses hexagonal-springboot-kt.