如何解决SQL错误:936,SQLState:42000,在查询中添加了“版本”列
Actual Query Created Using JQL
@Query("insert into AudienceResponseInteraction(engagementSplitPointId,journeyAudience,eventId,audienceResponse) select ar.point.id,ar.journeyAudience,ar.audienceResponseEventMaster.id,ar from AudienceResponse ar where ar.point.id=?2 and ar.audienceResponseEventMaster.id in(?3) and ar in(?1)")
Query in Logs after spring.jpa.show-sql=true
insert into AudienceResponseInteraction ( **version**,engagementSplitPointId,audienceId,audienceResponseId ) select ?,audiencere0_.touchPointId as col_0_0_,audiencere0_.audienceId as col_1_0_,audiencere0_.eventId as col_2_0_,audiencere0_.id as col_3_0_ from AudienceResponse audiencere0_ where audiencere0_.touchPointId=? and (audiencere0_.eventId in (?)) and (audiencere0_.id in ())
JQL会自行添加版本列,这是什么问题以及如何解决
public class AudienceResponseInteraction extends AbstractEntity {
private static final long serialVersionUID = -2511938602547023652L;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "audienceResponseId",referencedColumnName = "id",nullable = false)
private AudienceResponse audienceResponse;
@Column(nullable = false)
private Long engagementSplitPointId;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "audienceResponseMetaDataId",nullable = true)
private AudienceResponseMetaData audienceResponseMetaData;
@Column(nullable = false)
private Long eventId;
@Column(name = "isProcessed",nullable = false)
private boolean isProcessed;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "audienceId",nullable = false)
private JourneyAudience journeyAudience;
}
以上实体继承了抽象实体,whoich的版本为字段
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。