我阅读了很多关于我的问题的文档,但建议无法解决我的问题,所以我不得不打开这个话题。
我的问题是,当我尝试保存我的实体时,出现以下错误。我添加了我的实体类。谢谢。
保存代码
@Transactional
@Override
public void saveEmployee(EmployeeTable employeeToSave)
{
employeeDao.saveOrUpdate(employeeToSave);
}
员工表
package de.adesso.kkBonus.model;
import com.google.common.collect.Lists;
import de.adesso.kkBonus.enums.*;
import de.adesso.kkBonus.util.BillConstants;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.hibernate.annotations.Cascade;
import org.springframework.beans.BeanUtils;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "employee_table")
@EqualsAndHashCode(of = {"id"})
@ToString(of = "id")
public class EmployeeTable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;
@Column(name = "deleted")
private boolean deleted;
@Column(name = "name", length = 200, nullable = false)
private String name;
@Column(name = "tckn", length = 11)
private String tckn;
慕运维8079593
相关分类