can I use kotlin delegation properties in combinat...
# spring
t
can I use kotlin delegation properties in combination with spring data
@Embedded
? I am trying to implement auditing and delegation seems to break the behavior (which I understand at some unconscious level I cannot explain) Basically,
Copy code
@Embeddable
data class BaseAuditable(
	@Column(name = "modified_at")
	@LastModifiedDate
	var modifiedAt: Date? = Date(),
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "modified_by")
	@LastModifiedBy
	var modifiedBy: Auditor? = null,
	@Column(name = "created_at")
	@CreatedDate
	var createdAt: Date? = null,
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "created_by")
	@CreatedBy
	var createdBy: Auditor? = null
)

@Entity(name = "masterplan")
@EntityListeners(AuditingEntityListener::class)
data class Masterplan(
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	val id: Int? = null
) {
	@Embedded
	var auditable: BaseAuditable = BaseAuditable()
works as I expect, but then I don't have access to
masterplan.createdBy
directly