hibernate4注解字段为mysql的text

文章的正文detail就需要设置为text

在getter方法上添加注解

 @Lob
    @Basic(fetch = FetchType.LAZY)
    @Type(type = "text")
    @Column(name = "detail", nullable = true)
    public String getDetail() {
        return detail;
    }

删除表,让hibernate自己建表

运行效果

猜你喜欢

转载自www.cnblogs.com/jnhs/p/11438742.html