hibernate不能get字符型主键数据


没有找到更好的解决办法:
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));
}

你可能感兴趣的:(java,Hibernate)