Java HQL:未找到命名参数,即使它存在
我收到异常,无法找到命名参数,即使它存在Java HQL:未找到命名参数,即使它存在,java,hibernate,hql,Java,Hibernate,Hql,我收到异常,无法找到命名参数,即使它存在 org.hibernate.QueryParameterException: could not locate named parameter [type] 质疑 我根本不明白问题出在哪里。您的查询缺少括号和value关键字 试一试 不是重复的@Andremoniy,只是打字错误 String query = ("insert into my_table (abc_id, dup_id,type_code) "+
org.hibernate.QueryParameterException: could not locate named parameter [type]
质疑
我根本不明白问题出在哪里。您的查询缺少括号和
value
关键字
试一试
不是重复的@Andremoniy,只是打字错误
String query = ("insert into my_table (abc_id, dup_id,type_code) "+
" (abc_seq.nextval, 2,:type");
Query myQuery = em.createNativeQuery(query);
nativeQuery.setParameter("type", code);
String query = ("insert into my_table (abc_id, dup_id,type_code) "+
"values (abc_seq.nextval, 2,:type)");
Query myQuery = em.createNativeQuery(query);
nativeQuery.setParameter("type", code);