NutzCN Logo
问答 查询数据里存在的数据可是得到的结果却不完整
发布于 2535天前 作者 dengwubogit 1623 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk

查询数据里存在的数据可是得到的结果却不完整
1.domain中没有过滤任何字段的

**
 * Created by Administrator on 2018/1/12.
 */
@Table("wm_attendance_record")
public class AttendanceRecord extends BaseModel {
    @Column
    @Name
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @Prev(els = {@EL("uuid()")})
    private String id;

    @Column("project_id")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String projectId;

    @Column("team_id ")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String teamId;

    @Column("labor_id ")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String laborId;

    @Column("worker_id ")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String workerId;

    @Column("am_on")
    @ColDefine(type = ColType.DATETIME)
    private Date amOn;

    @Column("am_off")
    @ColDefine(type = ColType.DATETIME)
    private Date amOff;

    @Column("pm_on")
    @ColDefine(type = ColType.DATETIME)
    private Date pmOn;

    @Column("pm_off")
    @ColDefine(type = ColType.DATETIME)
    private Date pmOff;

    @Column("am_on_status")
    @ColDefine(type = ColType.INT)
    private int amOnStatus;

    @Column("am_off_status")
    @ColDefine(type = ColType.INT)
    private int amOffStatus;

    @Column("pm_on_status")
    @ColDefine(type = ColType.INT)
    private int pmOnStatus;

    @Column("pm_off_status")
    @ColDefine(type = ColType.INT)
    private int pmOffStatus;

    @Column()
    @ColDefine(type = ColType.DATE)
    private Date recordDT;
  1. 我创建了对象并且保存到数据库中(数据都是写死的包括ID)
    数据库中也确实保存了,并且数据都是完整的
  AttendanceRecord record = new AttendanceRecord();
            record.setLaborId(laborId);
            record.setProjectId(projectId);
            record.setWorkerId(workerId);
            record.setTeamId(teamId);
            record.setAmOn(real_amon);
            record.setAmOff(real_amoff);
            record.setPmOn(real_pmon);
            record.setPmOff(real_pmoff);
            record.setRecordDT(date);
            AttendanceRecord insert = dao().insert(record);
  1. 我通过ID fetch 这条数据也有结果返回,但是丢失了 laborId workerId teamId 这三个字段的值.显示为null
1 回复

多了空格

  @Column("team_id ")
添加回复
请先登陆
回到顶部