org.hibernate.QueryException: could not resolve property: depreciationDay of: com.cqta.oatianai.model.Depreciation

NO.1 映射出了问题。查找不到。代码如下

 1/**
 2     * 折旧记录检索
 3     */
 4    @SuppressWarnings("unchecked")
 5    public List<Depreciation> queryDepreciationList(String name, String number, Date startTime, Date endTime) {
 6
 7        Criteria criteria = getSession().createCriteria(Depreciation.class, "s").createAlias("s.asset", "a");
 8        // 起始日期
 9        if (startTime != null) {
10            criteria.add(Restrictions.gt("s.depreciationDay ", startTime));
11        }
12        // 截止日期
13        if (endTime != null) {
14            criteria.add(Restrictions.lt("s.depreciationDay ", endTime));
15        }
16        if (name != null && !name.trim().equals("")) {
17            criteria.add(Restrictions.like("a.name", name, MatchMode.ANYWHERE));
18        }
19        if (number != null && !number.trim().equals("")) {
20            criteria.add(Restrictions.like("a.number", number, MatchMode.ANYWHERE));
21        }
22    
23        List<Depreciation> items = criteria.list();
24        DebugUtil.showAllPorperty(items);
25        return items;
26        
27    }

NO.2 仔细核对查找代码中的该属性配置,泪流满面之后 发现属性后面多了个空格........GG...



追逐和梦想一样的激情,暖暖的火焰点燃生命,度过暖暖的每一天...

posted on 2010-10-14 13:32 无尽海 阅读(1554) 评论(0)  编辑  收藏 所属分类: hibernate


只有注册用户登录后才能发表评论。


网站导航:
 
<2010年10月>
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456

导航

统计

公告

好久没来了...

常用链接

留言簿

随笔分类(3)

随笔档案(5)

友情链接

最新随笔

搜索

最新评论

阅读排行榜

评论排行榜