integer[]
次のクエリで作成されたtype の列があります。
...
questions int[] DEFAULT '{}',
...
Hibernate のクエリ機能を使用して一連の整数を挿入しようとしています。
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();
これは正常に実行されず、例外がスローされます。
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.
整数のセットをデータベースに挿入するにはどうすればよいですか?