Search in sources :

Example 1 with JaxbIndex

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

the class JPAXMLOverriddenAnnotationReader method buildIndex.

private static void buildIndex(AnnotationDescriptor annotation, List<JaxbIndex> elements) {
    Index[] indexes = new Index[elements.size()];
    int i = 0;
    for (JaxbIndex element : elements) {
        AnnotationDescriptor indexAnn = new AnnotationDescriptor(Index.class);
        copyAttribute(indexAnn, "name", element.getName(), false);
        copyAttribute(indexAnn, "column-list", element.getColumnList(), true);
        copyAttribute(indexAnn, "unique", element.isUnique(), false);
        indexes[i++] = AnnotationFactory.create(indexAnn);
    }
    annotation.setValue("indexes", indexes);
}
Also used : AnnotationDescriptor(org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor) JaxbIndex(org.hibernate.boot.jaxb.mapping.spi.JaxbIndex) JaxbIndex(org.hibernate.boot.jaxb.mapping.spi.JaxbIndex) Index(jakarta.persistence.Index) JaxbUniqueConstraint(org.hibernate.boot.jaxb.mapping.spi.JaxbUniqueConstraint) QueryHint(jakarta.persistence.QueryHint) JaxbQueryHint(org.hibernate.boot.jaxb.mapping.spi.JaxbQueryHint) UniqueConstraint(jakarta.persistence.UniqueConstraint)

Aggregations

Index (jakarta.persistence.Index)1 QueryHint (jakarta.persistence.QueryHint)1 UniqueConstraint (jakarta.persistence.UniqueConstraint)1 AnnotationDescriptor (org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor)1 JaxbIndex (org.hibernate.boot.jaxb.mapping.spi.JaxbIndex)1 JaxbQueryHint (org.hibernate.boot.jaxb.mapping.spi.JaxbQueryHint)1 JaxbUniqueConstraint (org.hibernate.boot.jaxb.mapping.spi.JaxbUniqueConstraint)1