2
다음 쿼리로 만든 integer[]
유형의 열이 있습니다.정수 [] 유형의 열에 집합을 삽입하는 방법?
...
questions int[] DEFAULT '{}',
...
최대 절전 모드의 쿼리 기능을 사용하여 정수 세트를 삽입하려고합니다.
Set<Integer> questions = randomQuestions();
Query query = session.createSQLQuery("UPDATE contestant SET questions=:questions WHERE email=:email");
query.setParameterList("questions", questions);
query.setParameter("email", email);
query.executeUpdate();
이것은 성공적으로 실행되지 않고 throw 및 예외가 발생하지 않습니다.
Caused by: org.postgresql.util.PSQLException: ERROR: column "questions" is of type integer[] but expression is of type record
Hint: You will need to rewrite or cast the expression.
데이터베이스에 정수 세트를 삽입하는 방법은 무엇입니까?