如何找到Spring Data JPA和Spring版本的正确jar文件(How to find correct jar file of Spring Data JPA and Spring version)
我正在使用Spring MVC和Spring Data JPA,并面对jar版本的异常。
这是我的朋友:
<properties> <spring.version>4.2.4.RELEASE</spring.version> <hibernate.version>4.3.8.Final</hibernate.version> <mysql.version>5.1.10</mysql.version> <junit-version>4.11</junit-version> <servlet-api-version>3.1.0</servlet-api-version> <spring-security-version>4.0.4.RELEASE</spring-security-version> <spring-data-solr.verion>1.2.0.RELEASE</spring-data-solr.verion> <springbatch.version>3.0.6.RELEASE</springbatch.version> <jsp-version>2.1</jsp-version> <jstl-version>1.2</jstl-version> <java.version>1.7</java.version> <liquibase.version>3.1.1</liquibase.version> <spring.data.jpa.version>1.10.3.RELEASE</spring.data.jpa.version> <spring.social.version>1.1.0.RELEASE</spring.social.version> </properties>
这是我的班级:
import org.springframework.data.jpa.repository.JpaRepository; public interface RoleRepository extends JpaRepository<Role, Long> { }
我在Eclipse上收到一条错误警告消息:
The type org.springframework.data.repository.query.QueryByExampleExecutor cannot be resolved. It is indirectly referenced from required .class files
看起来我的Spring数据jpa jar版本不正确,但我不知道找到了正确的版本。 我的春天verion:4.2.4.RELEASE是最新的
如何解决这个错误? 非常感谢 !
I'm using Spring MVC and Spring Data JPA and facing with an exception of jar version.
This is my pom:
<properties> <spring.version>4.2.4.RELEASE</spring.version> <hibernate.version>4.3.8.Final</hibernate.version> <mysql.version>5.1.10</mysql.version> <junit-version>4.11</junit-version> <servlet-api-version>3.1.0</servlet-api-version> <spring-security-version>4.0.4.RELEASE</spring-security-version> <spring-data-solr.verion>1.2.0.RELEASE</spring-data-solr.verion> <springbatch.version>3.0.6.RELEASE</springbatch.version> <jsp-version>2.1</jsp-version> <jstl-version>1.2</jstl-version> <java.version>1.7</java.version> <liquibase.version>3.1.1</liquibase.version> <spring.data.jpa.version>1.10.3.RELEASE</spring.data.jpa.version> <spring.social.version>1.1.0.RELEASE</spring.social.version> </properties>
This is my class:
import org.springframework.data.jpa.repository.JpaRepository; public interface RoleRepository extends JpaRepository<Role, Long> { }
I received an error warning on Eclipse with message:
The type org.springframework.data.repository.query.QueryByExampleExecutor cannot be resolved. It is indirectly referenced from required .class files
It seem my Spring data jpa jar version is incorrect, but I don't know find correct version. My Spring verion: 4.2.4.RELEASE is latest
How to fix this error? Thank so much !
原文:https://stackoverflow.com/questions/43006156
最满意答案
下面是生成的缩进更好的JavaScript:
_(gameState.loot).pick(function(value, key) { return key !== "pickUpAnimations"; }).filter( (function(d) { return _.isArray(d); }).reduce((function(sum, d) { return sum.concat(d); })) );
正如你所看到的,
.filter (...
和.filter(...
不一样,两种可能的修正:
删除方法名称和开头括号之间的空格:
_(gameState.loot) .pick((value, key) -> key isnt "pickUpAnimations") .filter((d) -> _.isArray (d)) .reduce((sum, d) -> sum.concat (d))
完全删除括号:
_(gameState.loot) .pick (value, key) -> key isnt "pickUpAnimations" .filter (d) -> _.isArray (d) .reduce (sum, d) -> sum.concat (d)
你也可以去掉调用
_.isArray
的匿名函数:_(gameState.loot) .pick (value, key) -> key isnt "pickUpAnimations" .filter _.isArray .reduce (sum, d) -> sum.concat (d)
Here's the generated JavaScript with better indentation:
_(gameState.loot).pick(function(value, key) { return key !== "pickUpAnimations"; }).filter( (function(d) { return _.isArray(d); }).reduce((function(sum, d) { return sum.concat(d); })) );
As you can see,
.filter (...
and.filter(...
are not the same. Two possible fixes:
Remove the whitespace between the method names and the opening parentheses:
_(gameState.loot) .pick((value, key) -> key isnt "pickUpAnimations") .filter((d) -> _.isArray (d)) .reduce((sum, d) -> sum.concat (d))
Remove the parentheses entirely:
_(gameState.loot) .pick (value, key) -> key isnt "pickUpAnimations" .filter (d) -> _.isArray (d) .reduce (sum, d) -> sum.concat (d)
You can also get rid of the anonymous function calling
_.isArray
:_(gameState.loot) .pick (value, key) -> key isnt "pickUpAnimations" .filter _.isArray .reduce (sum, d) -> sum.concat (d)
相关问答
更多-
链接一系列异步调用(Chain a series of asynchronous calls)[2022-01-26]
当然有一些猜测涉及到你遇到这个问题的实际意图和用例。 此外,还不完全清楚什么something , somethingElse和something somethingElse (它们来自哪里以及它们应该去哪里)。 然而,根据你提供的信息,以及作为slartidan答案的补充(或者说是扩展或泛化):你在这里描绘的这些虚拟调用之间的区别似乎是 传递给get方法的String参数 被调用的Callback 接下来执行哪种方法 您可以将这些部分分解出来: String参数和Callback可以作为参数传递给创建Ca ... -
我不认为你正确地使用chain - 检查文档 ,你必须打开.value()调用值,就像在文档的例子中一样。 Tap实际上并不是先执行。 let id = null; _.chain(ids) .forEach(value => { id = _.result(_.find(value.refs, function(sku) { return sku.colorId === 'ROSE' && sku.sizeId === '14M'; }), 'sku ...
-
如文档中所述: https : //lodash.com/docs/4.17.4#reduce 将集合减少到一个值,该值是通过iteratee运行集合中每个元素的累积结果,其中每个连续调用都提供前一个的返回值。 如果未给出累加器,则将第一个集合元素用作初始值。 使用四个参数调用iteratee :( accumulator,value,index | key,collection)。 您可以执行以下操作 return _(myCollection) .filter(...) .map(...) .reduc ...
-
下面是生成的缩进更好的JavaScript: _(gameState.loot).pick(function(value, key) { return key !== "pickUpAnimations"; }).filter( (function(d) { return _.isArray(d); }).reduce((function(sum, d) { return sum.concat(d); })) ); 正如你所看到的, .fil ...
-
在单一值上使用Lodash链(Use Lodash chain on single value)[2022-05-22]
解决方案是使用head()而不是value() : var res = _([" test "]) .map(function(s) { return s + s; }) .map(_.trim) .head(); 或TypeScript: var res = _([" test "]) .map(s => s + s) .map(_.trim) .head(); 这种方式res只是一个字符串,代码更具可读性。 The solution was to ... -
为什么不通过Bower链接调用sortBy来安装lodash?(Why isn't lodash installed through Bower chaining calls to sortBy?)[2023-07-13]
原因是由Bower安装的文件之一lodash.underscore.js由Meteor自动包含在我的应用程序中。 这个版本的lodash似乎表现得像下划线,因为它不会自动链接。 The reason is that lodash.underscore.js, one of the files installed by Bower, is included in my app automatically by Meteor. This version of lodash seems to behave lik ... -
1) _.tap是mutate参数,最好使用_.thru 2)要获得链接结果,必须在链的末尾调用.value() 3)所以我的建议 _.chain('1,2,4') .split(',') .max() .thru(function(maxValue) { return _.chain(maxValue).times(_.constant(false)).value(); }) .value(); 如果真的不需要_. ...
-
你可以做类似的事情 _.chain(123) .thru(function(num) { return _.every([ // or _.some for any item _.isNumber(num), _.anotherCheck(num), _.anotherCheck(num) ]); }) .value(); you can do somthing like _.c ...
-
此方法可让您有效地搜索任意数量的数组中的交集。 function hasIntersection() { var collections = _.rest(arguments); return _.some(_.first(arguments), function(item) { return _(collections) .chain() .map(_.ary(_.partial(_.includes, item), 1)) ...
-
这是订单: 以下是实例化派生时实际发生的情况: 将派生的内存留出(足够用于Base和Derived部分) 调用适当的Derived构造函数 首先使用适当的Base构造函数构造Base对象。 如果未指定基础构造函数,则将使用默认构造函数。 初始化列表初始化变量 构造函数的主体执行 控制权返回给调用者 希望能帮助到你。 Here is the order: Here’s what actually happens when derived is instantiated: Memory for derived ...