Closed
Description
My entity bean has a persistent property of type short
with corresponding Setter/Getter:
public short getHornlength() {
return hornlength;
}
public void setHornlength( short hornlength ) {
this.hornlength = hornlength;
}
Using this in a TypedSort
Sort.TypedSort<Profile> sortedProfile = Sort.sort( Profile.class );
Sort sort = sortedProfile.by( Profile::getHornlength ).ascending();
List<Profile> sortedProfiles = profiles.findAll( sort );
results in
Caused by: org.springframework.aop.AopInvocationException: Null return value from advice does not match primitive return type for: public short com.tutego.boot.jpa.entity2.Profile.getHornlength()
at org.springframework.aop.framework.CglibAopProxy.processReturnType(CglibAopProxy.java:395) ~[spring-aop-5.3.16.jar:5.3.16]
at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85) ~[spring-aop-5.3.16.jar:5.3.16]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:700) ~[spring-aop-5.3.16.jar:5.3.16]
at com.tutego.boot.jpa.entity2.Profile$$EnhancerBySpringCGLIB$$c4896dd1.getHornlength(<generated>) ~[classes/:na]
Using my other non-primitive persistent properties works as expected:
Sort sort = sortedProfile.by( Profile::getBirthdate ).ascending()
.and( sortedProfile.by( Profile::getLastseen ).descending() );
Metadata
Metadata
Assignees
Labels
No labels