Coder Social home page Coder Social logo

Comments (3)

beikov avatar beikov commented on July 18, 2024

Hey, it is not possible to use the @Query annotation along with entity views. You will have to write that query with JPA Criteria e.g.

@Transactional(readOnly = true)
public interface NodeViewRepository extends EntityViewRepository<NodeView, Long> {

    default NodeView findRoot() {
        return findOne( ( root, query, cb ) -> cb.equal( root.get("name"), cb.literal("root") ) );
    }

    NodeView findOne(Specification<Node> spec);
}

from blaze-persistence.

mj-p avatar mj-p commented on July 18, 2024

After digging a bit more through the issue it makes sense this wont work.
Maybe the idea for our own Query annotation seems a bit overkill but should be doable I think?
I'd like to hear your thoughts on what we would need and if that's even something interesting to have.

from blaze-persistence.

beikov avatar beikov commented on July 18, 2024

It would be interesting, but that depends on #252 which is not so easy to implement. If jakartaee/persistence#29 were already available, I could just reuse the parser of the JPA provider instead, but having to implement a custom parser requires a lot of work and integration with the parsers of the JPA providers is probably even more work.

from blaze-persistence.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.