Buggy code:
@ Entity @ Table ( name = "audit_log_item" , uniqueConstraints = @ UniqueConstraint ( columnNames = { "uniqueKey" } ) ) public class JpaAuditLogItem extends BaseEntity implements AuditLogItem { @ Column ( nullable = false ) private String account ; @ Column ( nullable = false ) private String storeId ; @ Column ( nullable = false ) private String spaceId ; @ Column ( length = 1024 ) private String contentId ; private String contentMd5 ; private String mimetype ; private String contentSize ; @ Column ( length = 2048 ) private String contentProperties ; @ Column ( length = 2048 ) private String spaceAcls ; @ Column ( nullable = false ) private String action ; @ Column ( nullable = false ) private String username ; private String sourceSpaceId ; private String sourceContentId ; private String uniqueKey ; private boolean written = false ; @ Column ( nullable = false ) private Long timestamp ; @ Override public String getAccount ( ) { } @ Override public String getStoreId ( ) { } @ Override public String getSpaceId ( ) { } @ Override public String getContentId ( ) { } @ Override public String getContentMd5 ( ) { } @ Override public String getMimetype ( ) { } @ Override public String getContentSize ( ) { } @ Override public String getContentProperties ( ) { } @ Override public String getSpaceAcls ( ) { } @ Override public String getAction ( ) { } @ Override public String getUsername ( ) { } @ Override public String getSourceSpaceId ( ) { } @ Override public String getSourceContentId ( ) { } @ Override public long getTimestamp ( ) { } public void setAccount ( String account ) { } public void setStoreId ( String storeId ) { } public void setSpaceId ( String spaceId ) { } public void setContentId ( String contentId ) { } public void setContentMd5 ( String contentMd5 ) { } public void setMimetype ( String mimetype ) { } public void setContentSize ( String contentSize ) { } public void setContentProperties ( String contentProperties ) { } public void setSpaceAcls ( String spaceAcls ) { } public void setAction ( String action ) { } public void setUsername ( String username ) { } public void setSourceSpaceId ( String sourceSpaceId ) { } public void setSourceContentId ( String sourceContentId ) { } public void setTimestamp ( Long timestamp ) { } @ Column ( columnDefinition = "char(32)<seq2seq4repair_space>NOT<seq2seq4repair_space>NULL" ) @ Access ( AccessType . PROPERTY ) public String getUniqueKey ( ) { if ( ( uniqueKey ) == null ) { <START_BUG> this . uniqueKey = DigestUtils . md5Hex ( ( ( ( ( ( ( ( ( ( this . account ) + "//" ) + ( this . storeId ) ) + "//" ) + ( this . spaceId ) ) + "//" ) + ( ( this . contentId ) == null ? "<seq2seq4repair_space>" : this . contentId ) ) + "//" ) + ( this . timestamp ) ) ) ; <END_BUG> } return uniqueKey ; } public void setUniqueKey ( String uniqueKey ) { } public boolean isWritten ( ) { } public void setWritten ( boolean written ) { } }

Fix:
this . uniqueKey = DigestUtils . md5Hex ( ( ( ( ( ( ( ( ( ( ( ( this . action ) + "//" ) + ( this . account ) ) + "//" ) + ( this . storeId ) ) + "//" ) + ( this . spaceId ) ) + "//" ) + ( ( this . contentId ) == null ? "<seq2seq4repair_space>" : this . contentId ) ) + "//" ) + ( this . timestamp ) ) ) ;