Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-15-2021 11:36 AM
I have the following query which works fine:
@Query( "....(d)-[rdpr:CONTAINS*]->(pr) " +
"RETURN count(rdpr) > 0 as c")
boolean hasPermission(...);
now I'd like to extend the return statement with something like this:
@Query("....MATCH (d)-[rdpr:CONTAINS*]->(pr) " +
"RETURN CASE be.secured WHEN false THEN true ELSE (count(rdpr) > 0) END as allowed")
boolean hasPermission(...);
but it fails with the following error:
org.springframework.aop.AopInvocationException: Null return value from advice does not match primitive return type for: public abstract boolean com.example.domain.repository.neo4j.system.security.permission.PermissionRepository.hasPermission(..)
What am I doing wrong and how to fix it?
07-16-2021 01:57 AM
The result pattern ^^ returns NULL
in some cases and thus cannot be mapped to the primitive boolean
type. If you say, alright NULL
is a valid return value, you would have to use a Boolean
class instead of the primitive.
All the sessions of the conference are now available online