spring-projects / spring-projects/spring-data-rest
Provide a pom to allow maven builds [DATAREST-142]
@odrotbohm is already working on this.
Since Dec 31, 2020.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Thomas Darimont opened DATAREST-142 and commented
Github Author: sparmboy
Github Last-Updated: 2013-03-07T18:57:51Z
This issue was automatically imported from github
Bit of a long one this so bare with me.
We're currently using spring-data-rest 1.0.0.RELEASE
In our corporate environment, we have issues with using gradle via a proxy. See the following issue:
http://forums.gradle.org/gradle/topics/proxy_error-1r4f6
There doesnt appear to be a resolution to this, therefore we cant build spring-data-rest from source.
We're looking to build 1.1.0.M1 due the issues with Hibernate method level annotations as noted here:
https://github.com/SpringSource/spring-data-rest/issues/33
https://github.com/SpringSource/spring-data-rest/pull/56
The pull issue 56 mentions that fixes to the spring-data-commons and spring-data-jpa:
https://jira.springsource.org/browse/DATACMNS-269
https://jira.springsource.org/browse/DATAJPA-283
should fix this. To quote olivergierke:
"We've introduced the necessary changes in Spring Data Commons and JPA. The method annotations should now be discovered automatically without any need for changes in Spring Data REST."
However, when upgrading to these versions, there's still an issue with spring-data-rest 1.0.0.RELEASE, looking at the JpaEntityMetadata class:
From line 42:
<code>
for(Attribute attr : entityType.getAttributes()) {
boolean exported = true;
Field field = ReflectionUtils.findField(type, attr.getJavaMember().getName());
if(null == field) {
continue;
}
</code>
The line <code>attr.getJavaMember().getName()</code> returns the getter method as a member rather than the field (i.e. if my entity attribute is "name" this returns "getName").
The resultant call to ReflectionUtils.findField will always return null, as it is looking for a method name rather than a field name.
Because I cant build spring-data-rest 1.1.0.M1, and a build is not available in any public repos yet, my only option is to do an ugly hack to the ReflectionUtils in the springframework-core to check for methods as well as fields.
I'm open to any other work arounds or suggestions
Reference URL: https://api.github.com/repos/SpringSource/spring-data-rest/issues/81
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.