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