0
:JPA 또는 엔티티 관리자 거래 : 목록 내가 시도 <Long>
@Query("Select m.id from Cars m where m.id not in :x")
List<Long> findNotChoosenCars(@Param("x") List<Long> CarsId);
내가 얻을 : 나는 또한 넣어 위해 노력했다
org.postgresql.util.PSQLException: ERREUR: erreur de syntaxe sur ou près de «) »
Translation: syntax error near <<) >>
: X를 같이 괄호 : (: x)를
나는 또한 시도
@Query(value = "Select id from Cars where id not in (?1)",nativeQuery = true)
List<Long> findNotChoosenCars(List<Long> CarsId);
또한 :
private EntityManagerFactory emf;
private List<Long> getNotSelectedCarsIds(List<Long> selectedIds){
List<String>strings=selectedIds.stream().map(Object::toString).collect(Collectors.toList());
final String notSelectedCarIdsSql= "Select id from Car where id not in (:strings)";
return emf.createEntityManager().createNativeQuery(notSelectedMarkerIdsSql)
.setParameter("strings",strings)
.getResultList();
}
나는 여전히 같은 스택 트레이스 있습니다. 나는 포스트 그레스를 사용하고있다 9.4 어떤 도움을 주시겠습니까?
당신이 옳았습니다. null 인 경우 반환 값이 null이 될 것이라고 생각했습니다. 나는 실패 할 것이라고 기대하지 않았다. 고마워. – John