0
ich versucht habe:JPA oder EntityManager Deal mit Liste der Parameter: Liste <Long>
@Query("Select m.id from Cars m where m.id not in :x")
List<Long> findNotChoosenCars(@Param("x") List<Long> CarsId);
ich: wie in Klammern x:
org.postgresql.util.PSQLException: ERREUR: erreur de syntaxe sur ou près de «) »
Translation: syntax error near <<) >>
Ich habe auch zu setzen versucht (: x)
ich habe auch versucht
@Query(value = "Select id from Cars where id not in (?1)",nativeQuery = true)
List<Long> findNotChoosenCars(List<Long> CarsId);
Und auch:
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();
}
Ich habe immer noch die gleiche Stacktrace. Ich benutze Postgres 9.4 Irgendwelche Hilfe bitte?
Sie hatten Recht. Ich dachte, wenn Null der zurückgegebene Wert wäre null. Ich habe kein Versagen erwartet. Danke. – John