我想用一个getValueByLabel方法做一个简单的查询:
这是我的代码:
public Config getValueByLabel(String label) throws EntityPersistException{
    try {
        Query query = em.createQuery("select id from config where config_label=:label",Long.class);
        query.setParameter("label", label);
        List<Long> config = query.getResultList();
        return em.getReference(Config.class, config.get(0));
    }
...
当我想启动我得到的方法时:
org.hibernate.hql.internal.ast.QuerySyntaxException: config is not mapped [select id from config where config_label=:label]
任何想法如何解决这个问题?
更新
我在用:
hibernate 4.0.1.Final 和一个 postgresql db 1.16.1