quick compilation fix
This commit is contained in:
parent
3bec6f7eff
commit
5afdce78ea
@ -1,13 +1,12 @@
|
|||||||
package com.baeldung.jpa.stringcast;
|
package com.baeldung.jpa.stringcast;
|
||||||
|
|
||||||
import com.sun.istack.internal.Nullable;
|
|
||||||
|
|
||||||
import javax.persistence.EntityManager;
|
|
||||||
import javax.persistence.Query;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import javax.persistence.EntityManager;
|
||||||
|
import javax.persistence.Query;
|
||||||
|
|
||||||
public class QueryExecutor {
|
public class QueryExecutor {
|
||||||
|
|
||||||
public static List<String[]> executeNativeQueryNoCastCheck(String statement, EntityManager em) {
|
public static List<String[]> executeNativeQueryNoCastCheck(String statement, EntityManager em) {
|
||||||
@ -24,10 +23,7 @@ public class QueryExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (results.get(0) instanceof String) {
|
if (results.get(0) instanceof String) {
|
||||||
return ((List<String>) results)
|
return ((List<String>) results).stream().map(s -> new String[] { s }).collect(Collectors.toList());
|
||||||
.stream()
|
|
||||||
.map(s -> new String[] { s })
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
} else {
|
} else {
|
||||||
return (List<String[]>) results;
|
return (List<String[]>) results;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user