我正在研究一个Jhipster项目。
我正在通过为我的域提供以下注释来尝试使用审核功能
@Entity
@Table(name = "customer")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@EntityListeners(AuditingEntityListener.class)
public class Customer implements Serializable{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
@CreatedDate
@Column(name = "created_date")
private Instant createdDate;
@LastModifiedDate
@Column(name = "last_upd_date")
private Instant lastUpdDate;
@CreatedBy
@Column(name = "created_by_user")
private String createdByUser;
@LastModifiedBy
@Column(name = "last_upd_by_user")
private String lastUpdByUser;
一切在INSERTS上都可以正常工作,框架对所有字段都进行了正确设置,但是在更新时,@ CreateDate和@CratedBy始终为空。
我想了解为什么这种行为以及如何解决它。