Skip to content

Add abstract Entity base-class #13

@hohwille

Description

@hohwille

Most reasonable apps have more than one entity. It therefore always makes sense to have a mapped superclass that the entities extend that introduces the technical attributes for primary key (id property) and version (called modificationCounter in classic devon4j/spring, but could be a shorter name to avoid waste in JSON arrays).

In devon4j we have the following principle:
Such base classes are named Application«Aspect» and are part of the individual app and give you the flexibility and freedom to change and adopt to your needs. Rather than putting this in a library as we had done initially in oasp4j and as done in TKit.
Following this conventions helps us with a lot of things:

  • We can generate such class in CobiGen if it is missing but required
  • Following the naming convention we understand that it is some base infrastructure that should typically not clash with the naming of the application itself (business classes).
  • Also developers start understanding the concept and immediatly categorize classes according to that naming.
  • We can provide sample code in our documentation that is based on such classes (ApplicationPersistenceEntity, ApplicationDaoImpl, etc.) and if required technical differences between spring or quarkus can be abstracted but the programming model and coding patterns get universal for both worlds.

To make it short:
This story is about adding an abstract class ApplicationPersistenceEntity to our reference app and extend other entities from it.

Please also note that TKit also has a second such entity with a UUID primary key (as String).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions