Skip to content

readonly properties should not have setters #3

@klkvsk

Description

@klkvsk

It is possible that entity can have readonly properties. Example cases:

  • entity data comes from materialized view
  • field value comes from generated column
  • field value set elsewhere outside entity, e.g. with custom UPDATE queries, or from other app sharing this db
  • property is set in constructor for a new entity and persisted forever in that state

A readonly access modifier becomes useful here to enforce that no modifications are allowed. But with it, generated setter methods are invalid.

Generator should omit setter methods for fields, embeddeds and to-one associations, if a property is readonly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions