springboot jpa---->总结一下遇到的问题
2021-04-30 07:29
标签:interface keystone 数据库 epo spring trie 遇到的问题 EDA let 解决方法有两种 jpa中只有save方法,如果你传递的对象的主键在数据库中存在,那么就是更新操作。否则就是插入操作。 总结一下遇到的问题,soscw.com" target="_blank">springboot jpa---->总结一下遇到的问题 标签:interface keystone 数据库 epo spring trie 遇到的问题 EDA let 原文地址:https://www.cnblogs.com/huhx/p/13228766.htmlNative Query throw exception
import lombok.Value;
@Value
public class IdsOnly {
Integer id;
String otherId;
}
public interface TestTableRepository extends JpaRepository
List
org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [org.springframework.data.jpa.repository.query.AbstractJpaQuery$TupleConverter$TupleBackedMap] to type [com.example.IdsOnly]
public interface IdsOnly {
Integer getId();
String getOtherId();
}
@Query("select new com.example.IdsOnly(t.id, t.otherId) from TestTable t where t.creationDate > ?1")
Jpa中没有update方法
Delete operation
JpaRepository Not supported for DML operations [delete query]
@Modifying
@Modifying
void deleteByUserIdAndToolId(Integer userId, Integer toolId);
@Transactional
@Transactional
public void doDeleteUserTool(Integer userId, Integer toolId) {
userToolMapper.deleteByUserIdAndToolId(userId, toolId);
}
To be continue
Industry is the soul of business and the keystone of prosperity.
文章标题:springboot jpa---->总结一下遇到的问题
文章链接:http://soscw.com/index.php/essay/80322.html