弹簧靴中的jParepository投掷例外2.6.5
我刚刚升级到 2.6.5 并出现了一个新问题,这在 2.6.4 中没有发生。我有以下实体:
@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;
}
}
相应存储库中的此查询方法在 2.6.4 中完美运行:
List<Connection> findAllByNameContainsAndStatusEqualsOrderByNameAscPortAsc(String name, ConnectionStatus status);
升级到 2.6.5 后,我得到此异常:
java.lang.IllegalArgumentException: Parameter value [\] did not match expected type [java.lang.String (n/a)]
有什么想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个休眠的错误: https://hibernate.atlassian.atlassian.atlassian.net/browse/browse/browse/browse/hhh-15142 <-hh-15142 < /a>
由于仅使用Hibernates版本
5.6.6
引入回归,因此可以通过将Hibernate降级到5.6.5
来避免使用。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 to5.6.5