How to get array info from column in Spring Boot JPA (exception Dialect mapping for JDBC type Error)
Archived 2 years ago
D
direct_x_34
Script Kiddie!
I have a problem to get
Here is the entity shown below
Here is the JPARepository shown below
I got nested exception Dialect mapping for JDBC type?
How can I fix it?
["role1","role2","role3"] from roles column.Here is the entity shown below
@Entity
public class User {
//...
@Column(columnDefinition = "text[]")
@Type(type = "com.baeldung.hibernate.arraymapping.CustomStringArrayType")
private String[] roles;
// getters and setters
}Here is the JPARepository shown below
interface UserRepository extends JpaRepository<User, Long> {
@Query(value = "SELECT DISTINCT unnest(u.roles)::text FROM User u", nativeQuery = true)
List<String> findDistinctRoles();
}I got nested exception Dialect mapping for JDBC type?
How can I fix it?
