java(春季数据JPA)在i' m显式执行时未更新更新
我已经创建了一个名为dateTime数据类型的列的列,当我尝试使用java.sql.date之类的dateTime数据类型。 column.setupdated_at(new Java.sql.date(currentDate.getTime()));
即使执行save()没有错误,它也没有做任何事情。
还使用MySQL和Java.sql.sql.timestamp中的Java中的时间戳数据类型尝试了同一件事,没有运气。
I've created a column named updated-at with DATETIME datatype, when I try to update it in using java.sql.Date likecolumn.setUpdated_at(new java.sql.Date(currentDate.getTime()));
It doesn't do anything even though there is no error on executing save().
Also tried the same thing using TIMESTAMP datatype in MySQL and java.sql.Timestamp in Java, no luck.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
很难说,因为您没有提供足够的信息。请提供更多的上下文和代码。
我想说,如果我不得不基于您提供的少量信息来打扰,您不会打开交易或没有进行交易。
在春季,您可以使用@transactional注释
Hard to say, as you did not provide enough information. Please provide some more context and code.
If I had to quess based on the little information you gave, I would say, you did not open a Transaction or did not commit it.
In Spring you can use @Transactional annotation