use of org.hibernate.boot.jaxb.mapping.spi.JaxbQueryHint in project hibernate-orm by hibernate.
the class JPAXMLOverriddenAnnotationReader method buildQueryHints.
private static void buildQueryHints(List<JaxbQueryHint> elements, AnnotationDescriptor ann) {
List<QueryHint> queryHints = new ArrayList<>(elements.size());
for (JaxbQueryHint hint : elements) {
AnnotationDescriptor hintDescriptor = new AnnotationDescriptor(QueryHint.class);
String value = hint.getName();
if (value == null) {
throw new AnnotationException("<hint> without name. " + SCHEMA_VALIDATION);
}
hintDescriptor.setValue("name", value);
value = hint.getValue();
if (value == null) {
throw new AnnotationException("<hint> without value. " + SCHEMA_VALIDATION);
}
hintDescriptor.setValue("value", value);
queryHints.add(AnnotationFactory.create(hintDescriptor));
}
ann.setValue("hints", queryHints.toArray(new QueryHint[queryHints.size()]));
}
Aggregations