use of org.hibernate.boot.jaxb.mapping.spi.JaxbJoinColumn in project hibernate-orm by hibernate.
the class JPAXMLOverriddenAnnotationReader method buildJoinColumns.
private void buildJoinColumns(List<Annotation> annotationList, List<JaxbJoinColumn> elements) {
JoinColumn[] joinColumns = getJoinColumns(elements, false);
if (joinColumns.length > 0) {
AnnotationDescriptor ad = new AnnotationDescriptor(JoinColumns.class);
ad.setValue("value", joinColumns);
annotationList.add(AnnotationFactory.create(ad));
}
}
use of org.hibernate.boot.jaxb.mapping.spi.JaxbJoinColumn in project hibernate-orm by hibernate.
the class JPAXMLOverriddenAnnotationReader method getJoinColumns.
private JoinColumn[] getJoinColumns(List<JaxbJoinColumn> subelements, boolean isInverse) {
List<JoinColumn> joinColumns = new ArrayList<>();
if (subelements != null) {
for (JaxbJoinColumn subelement : subelements) {
AnnotationDescriptor column = new AnnotationDescriptor(JoinColumn.class);
copyAttribute(column, "name", subelement.getName(), false);
copyAttribute(column, "referenced-column-name", subelement.getReferencedColumnName(), false);
copyAttribute(column, "unique", subelement.isUnique(), false);
copyAttribute(column, "nullable", subelement.isNullable(), false);
copyAttribute(column, "insertable", subelement.isInsertable(), false);
copyAttribute(column, "updatable", subelement.isUpdatable(), false);
copyAttribute(column, "column-definition", subelement.getColumnDefinition(), false);
copyAttribute(column, "table", subelement.getTable(), false);
joinColumns.add(AnnotationFactory.create(column));
}
}
return joinColumns.toArray(new JoinColumn[joinColumns.size()]);
}
Aggregations