admin管理员组

文章数量:1636810

问题:composite-id class must implement Serializable因为在映射文件.hbm.xml中定义为联合主键使用联合主键时,bean类必须序列化,在项目中定位到com.xxx.pojo包下的类Organization,在封装类上添加代码import java.io.Serializable 实现这个接口;
例:

package com.cc.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

@Data
public class Student implements Serializable {
    private  Integer id;
    private  String studentName;
    private  Integer age;
    private  Integer weight;
    private  Integer sex;
    private  String hobby;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date birthday;
    private String fileName;


}

本文标签: idcompositeclassserializableimplement