读书人

hibernate注脚使用

发布时间: 2012-09-29 10:30:01 作者: rapoo

hibernate注解使用

今天写了个po类,无论怎么运行环境,都产生不了表,后来才知道是关键字的问题。

public RasDescPo findById(String id)    {        if (StringUtils.isEmpty(id))        {            return null;        }        List<RasDescPo> rasDescPos = getHibernateTemplate().find("from RasDescPo where RasDescPo.id=?", id);        if (CollectionUtils.isEmpty(rasDescPos))        {            return null;        }        return rasDescPos.get(0);    }

?可以解决问题。

读书人网 >开源软件

热点推荐