Home > Database > Mysql Tutorial > body text

代码-mysql中字段为text类型使用mybatis的Criteria查询无法进行封装

WBOY
Release: 2016-06-06 09:38:12
Original
2177 people have browsed it

代码mybatismysql数据库

这是我的数据库

<code> tb_item_param  CREATE TABLE `tb_item_param` (                                                                        `id` bigint(20) NOT NULL AUTO_INCREMENT,                                                            `item_cat_id` bigint(20) DEFAULT NULL COMMENT '商品类目ID',                                     `param_data` text COMMENT '参数数据,格式为json格式',                                     `created` datetime DEFAULT NULL,                                                                    `updated` datetime DEFAULT NULL,                                                                    PRIMARY KEY (`id`),                                                                                 KEY `item_cat_id` (`item_cat_id`)                                                                 ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8 COMMENT='商品规则参数'  </code>
Copy after login

我的代码

<code> public void itemParamList(int page, int rows) {        EUIDataGridResult result = new EUIDataGridResult();        TbItemParamExample example  = new TbItemParamExample();        Criteria criteria = example.createCriteria();        criteria.andIdEqualTo((long)1);        //PageHelper.startPage(page, rows);        List<tbitemparam> list = itemParamMapper.selectByExample(example);        TbItemParam tbItemParam = list.get(0);        //TbItemParam itemParam = itemParamMapper.selectByPrimaryKey((long)1);        System.out.println(tbItemParam.getParamData());</tbitemparam></code>
Copy after login

配置文件都是对的 查询出来的id什么都ok就是ParamData字段为null?TbItemParam pojo中ParamData字段是String类型,,为什么封装不进去?
pojo与mapper都是逆向工程生成的代码。。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!