How can I include JPA 2.1 feature in Maven project?

Im using Maven 3, JPA 2.1 and Hibernate 4.3.5.Final. I want to use JPA 2.1 because it offers several features, especially adding conditions to the outer outer join clauses. I have included the following dependencies in my Maven project ...



However, when I try to compile the following, I get a compilation error ("cannot find the symbol") in the ".on (" section.

    final CriteriaBuilder cb = m_entityManager.getCriteriaBuilder();
    CriteriaQuery<Message> query = cb.createQuery(Message.class);
    Root<Message> messageRoot = query.from(Message.class);
    final Join<Message, Group> groupJoin = messageRoot.join(;
    final Join<Message, MessageReadDate> msgReadDateJoin = messageRoot.join(Message_.messageReads, JoinType.LEFT);
    msgReadDateJoin.on(msgReadDateJoin.get(MessageReadDate_.recipient), recipient);


What libraries do I need to include in my Maven project in order to get JPA 2.1 and hence the "join.on" functionality?


source to share

1 answer

It might be a maven issue. It usually happens if the jars that he loaded are damaged for some reason. Delete the .m2 folder repository and again mvn install

, it should bring all the enw banners and compilation.

m2 folder here



All Articles