can not use spring-data-jpa repository with NamedQuery


in spring-data-jpa named queries are used to implement repository interface methods, see

for example

@NamedQuery(name = "Foo.findByBar", query = "select f from Foo f where :bar member of f.bars")
public class Foo implements Persistable<Long> {
    private Set<String> bars;

will be used to implement

public interface FooRepository extends JpaRepository<Foo, Long> {
    Foo findByBar(String bar);

to match the method parameter to the query parameter, spring have to check the query for named parameters

    public static boolean hasNamedParameter(Query query) {

        for (Parameter<?> parameter : query.getParameters()) {
            if (parameter.getName() != null) {
                return true;

        return false;


but getParameters throws UnsupportedOperationException


java.lang.UnsupportedOperationException: Unsupported feature - Typed Parameters are not supported yet
at com.objectdb.o.JPE.g(
at com.objectdb.o.ERR.f(
at com.objectdb.o.OBC.onObjectDBError(
at com.objectdb.o.OST.F(
at com.objectdb.jpa.JpaQuery.getParameters(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(
at $Proxy24.getParameters(Unknown Source)


do you think this can be fixed?

thanks in advanced

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

works perfectly,

thanks again for this quick response

Post Reply

To post a reply and/or subscribe to update notifications - please login