Skip to content

Commit

Permalink
fix: make user entity a data class
Browse files Browse the repository at this point in the history
* change from class to data class
* do not override abstract audit properties
  • Loading branch information
ACMarcus authored Aug 30, 2023
1 parent 6d77761 commit e3fa0c1
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ import org.springframework.data.couchbase.core.mapping.id.GenerationStrategy.USE
<%_ if (searchEngineElasticsearch) { _%>
@org.springframework.data.elasticsearch.annotations.Document(indexName = "user")
<%_ } _%>
class <%= asEntity('User') %> (
data class <%= asEntity('User') %> (
<%_ if (databaseTypeSql) { _%>
@Id
Expand Down Expand Up @@ -398,12 +398,8 @@ class <%= asEntity('User') %> (
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
<%_ } _%>
var persistentTokens: MutableSet<PersistentToken> = mutableSetOf()<% } %><% if (databaseTypeSql || databaseTypeMongodb || databaseTypeNeo4j || databaseTypeCouchbase) { %>,
createdBy: String? = null,
createdDate: Instant? = Instant.now(),
lastModifiedBy: String? = null,
lastModifiedDate: Instant? = Instant.now()
<%_ } _%>
) : <% if (databaseTypeSql || databaseTypeMongodb || databaseTypeNeo4j || databaseTypeCouchbase) { %>AbstractAuditingEntity<<%= user.primaryKey.type %>>(createdBy, createdDate, lastModifiedBy, lastModifiedDate), <% } %>Serializable {
) : <% if (databaseTypeSql || databaseTypeMongodb || databaseTypeNeo4j || databaseTypeCouchbase) { %>AbstractAuditingEntity<<%= user.primaryKey.type %>>(), <% } %>Serializable {
<%_ if (databaseTypeSql && reactive) { _%>
@PersistenceConstructor
Expand Down

0 comments on commit e3fa0c1

Please sign in to comment.