Martin
Martin

Reputation: 2235

JpaRepository throwing exception in spring boot 2.6.5

I just upgraded to 2.6.5 and a new issue appeared, this was not happening in 2.6.4. I have the following entity :

@Entity
@Table(name="tblInterfaceConnection")
@NoArgsConstructor
@EqualsAndHashCode(of="uuid")
@Getter
@Setter
@ToString
public class Connection implements Serializable 
{
@Serial
private static final long serialVersionUID = 8426179776707246860L;

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(nullable = false, unique = true)
private String uuid = UUID.randomUUID().toString();

@Column(nullable = false)
private String name;

@Column(nullable = false)
private Integer port;

@Enumerated(EnumType.STRING)
@Column(nullable = false, length = 20)
private ConnectionType type;

@Enumerated(EnumType.STRING)
@Column(nullable = false, length = 6)
private SocketType socketType;

@Enumerated(EnumType.STRING)
@Column(nullable = false, length = 12)
private ConnectionStatus status;

public Connection(String name, Integer port, ConnectionType type, SocketType socketType, ConnectionStatus status) 
{
    this.name = name;
    this.port = port;
    this.type = type;
    this.socketType = socketType;
    this.status = status;
}
}

This query method in the corresponding repo works perfectly in 2.6.4 :

List<Connection> findAllByNameContainsAndStatusEqualsOrderByNameAscPortAsc(String name, ConnectionStatus status);

After upgrading to 2.6.5 I get this exception :

java.lang.IllegalArgumentException: Parameter value [\] did not match expected type [java.lang.String (n/a)]

Any idea?

Upvotes: 2

Views: 366

Answers (1)

Jens Schauder
Jens Schauder

Reputation: 81862

This is a Hibernate bug:https://hibernate.atlassian.net/browse/HHH-15142 Since the regression was only introduced with Hibernates version 5.6.6 you may avoid it by downgrading Hibernate to 5.6.5

Upvotes: 2

Related Questions