没有找到更好的解决办法:
public MusicUsers findById(java.lang.String id) {
String queryString = "from MusicUsers as model where model.userId = '" + id + "'";
List<MusicUsers> l = getHibernateTemplate().find(queryString);
return (MusicUsers) (l.size() == 0 ? null : l.get(0));
}