用springboot+mybatis取出数据contant字段总是显示null(查了一下午debug没找出来)

实现类

public Page<Person> getNewPersonList( Integer currentPage, Integer pageSize) {
        // 实例化查询条件
        final PersonExample personExample = new PersonExample();
        PersonExample.Criteria criteria = personExample.createCriteria();
        criteria.andIsDeleteEqualTo((byte)0);
        // 获取查询结果集
        Page<Person> result = PageHelper.startPage(currentPage, pageSize).doSelectPage(new ISelect() {
            @Override
            public void doSelect() {
//                personRepository.selectByExample(personExample);
                personRepository.selectByExample(personExample);
            }
        });
        return result;
    }

其中返回值得实体类的代码:

package com.ebiz.code.repository.api.entity;

import java.util.Date;

public class Person {
    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ebiz_person.id
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    private Integer id;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ebiz_person.name
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    private String name;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ebiz_person.duty
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    private String duty;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ebiz_person.Email
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    private String email;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ebiz_person.phone
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    private String phone;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ebiz_person.place
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    private String place;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ebiz_person.is_delete
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    private Byte isDelete;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ebiz_person.create_time
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    private Date createTime;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ebiz_person.update_time
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    private Date updateTime;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ebiz_person.photo
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    private String photo;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ebiz_person.type
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    private Byte type;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column ebiz_person.contant
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    private String contant;

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ebiz_person.id
     *
     * @return the value of ebiz_person.id
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public Integer getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ebiz_person.id
     *
     * @param id the value for ebiz_person.id
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ebiz_person.name
     *
     * @return the value of ebiz_person.name
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public String getName() {
        return name;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ebiz_person.name
     *
     * @param name the value for ebiz_person.name
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ebiz_person.duty
     *
     * @return the value of ebiz_person.duty
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public String getDuty() {
        return duty;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ebiz_person.duty
     *
     * @param duty the value for ebiz_person.duty
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public void setDuty(String duty) {
        this.duty = duty;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ebiz_person.Email
     *
     * @return the value of ebiz_person.Email
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public String getEmail() {
        return email;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ebiz_person.Email
     *
     * @param email the value for ebiz_person.Email
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ebiz_person.phone
     *
     * @return the value of ebiz_person.phone
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public String getPhone() {
        return phone;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ebiz_person.phone
     *
     * @param phone the value for ebiz_person.phone
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public void setPhone(String phone) {
        this.phone = phone;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ebiz_person.place
     *
     * @return the value of ebiz_person.place
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public String getPlace() {
        return place;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ebiz_person.place
     *
     * @param place the value for ebiz_person.place
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public void setPlace(String place) {
        this.place = place;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ebiz_person.is_delete
     *
     * @return the value of ebiz_person.is_delete
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public Byte getIsDelete() {
        return isDelete;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ebiz_person.is_delete
     *
     * @param isDelete the value for ebiz_person.is_delete
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public void setIsDelete(Byte isDelete) {
        this.isDelete = isDelete;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ebiz_person.create_time
     *
     * @return the value of ebiz_person.create_time
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ebiz_person.create_time
     *
     * @param createTime the value for ebiz_person.create_time
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ebiz_person.update_time
     *
     * @return the value of ebiz_person.update_time
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ebiz_person.update_time
     *
     * @param updateTime the value for ebiz_person.update_time
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ebiz_person.photo
     *
     * @return the value of ebiz_person.photo
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public String getPhoto() {
        return photo;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ebiz_person.photo
     *
     * @param photo the value for ebiz_person.photo
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public void setPhoto(String photo) {
        this.photo = photo;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ebiz_person.type
     *
     * @return the value of ebiz_person.type
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public Byte getType() {
        return type;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ebiz_person.type
     *
     * @param type the value for ebiz_person.type
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public void setType(Byte type) {
        this.type = type;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method returns the value of the database column ebiz_person.contant
     *
     * @return the value of ebiz_person.contant
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public String getContant() {
        return contant;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method sets the value of the database column ebiz_person.contant
     *
     * @param contant the value for ebiz_person.contant
     *
     * @mbg.generated Sat May 11 13:04:24 CST 2019
     */
    public void setContant(String contant) {
        this.contant = contant;
    }
}

数据库图字段没写错
图片说明

qq_37244670
卢本伟NB 发现是eample发放有一个字段没有逆向生成
大约一年之前 回复
qq_37244670
卢本伟NB 然后同一个 personRepository通过id就能查出来
大约一年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问