弹簧靴中的jParepository投掷例外2.6.5

发布于 2025-01-18 04:00:59 字数 1491 浏览 1 评论 0原文

我刚刚升级到 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文