use of org.hibernate.boot.jaxb.mapping.spi.JaxbUniqueConstraint in project hibernate-orm by hibernate.
the class JPAXMLOverriddenAnnotationReader method buildUniqueConstraints.
private static void buildUniqueConstraints(AnnotationDescriptor annotation, List<JaxbUniqueConstraint> elements) {
UniqueConstraint[] uniqueConstraints = new UniqueConstraint[elements.size()];
int i = 0;
for (JaxbUniqueConstraint element : elements) {
String[] columnNames = element.getColumnName().toArray(new String[0]);
AnnotationDescriptor ucAnn = new AnnotationDescriptor(UniqueConstraint.class);
copyAttribute(ucAnn, "name", element.getName(), false);
ucAnn.setValue("columnNames", columnNames);
uniqueConstraints[i++] = AnnotationFactory.create(ucAnn);
}
annotation.setValue("uniqueConstraints", uniqueConstraints);
}
Aggregations