Search in sources :

Example 1 with JaxbNamedQuery

use of org.hibernate.boot.jaxb.mapping.spi.JaxbNamedQuery in project hibernate-orm by hibernate.

the class JPAXMLOverriddenAnnotationReader method buildNamedQueries.

public static List<NamedQuery> buildNamedQueries(List<JaxbNamedQuery> elements, XMLContext.Default defaults, ClassLoaderAccess classLoaderAccess) {
    List<NamedQuery> namedQueries = new ArrayList<>();
    for (JaxbNamedQuery element : elements) {
        AnnotationDescriptor ann = new AnnotationDescriptor(NamedQuery.class);
        copyAttribute(ann, "name", element.getName(), false);
        copyAttribute(ann, "query", element.getQuery(), true);
        buildQueryHints(element.getHint(), ann);
        copyAttribute(ann, "lock-mode", element.getLockMode(), false);
        namedQueries.add(AnnotationFactory.create(ann));
    }
    return namedQueries;
}
Also used : AnnotationDescriptor(org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor) ArrayList(java.util.ArrayList) JaxbNamedQuery(org.hibernate.boot.jaxb.mapping.spi.JaxbNamedQuery) NamedQuery(jakarta.persistence.NamedQuery) JaxbNamedQuery(org.hibernate.boot.jaxb.mapping.spi.JaxbNamedQuery)

Aggregations

NamedQuery (jakarta.persistence.NamedQuery)1 ArrayList (java.util.ArrayList)1 AnnotationDescriptor (org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor)1 JaxbNamedQuery (org.hibernate.boot.jaxb.mapping.spi.JaxbNamedQuery)1