use of com.sun.jdo.api.persistence.model.mapping.impl.MappingFieldElementImpl in project Payara by payara.
the class DatabaseGenerator method createAndAttachMappingField.
/**
* Create mapping field and add to mapping class
* @param fieldName a String for field name
* @param mappingClass mapping class object that field belong to
* @return mapping field object
* @throws ModelException
*/
private MappingFieldElement createAndAttachMappingField(String fieldName, MappingClassElement mappingClass, ColumnElement column) throws ModelException {
MappingFieldElement mappingField = new MappingFieldElementImpl(fieldName, mappingClass);
mappingClass.addField(mappingField);
mappingField.addColumn(column);
if (column.isBlobType()) {
mappingField.setFetchGroup(MappingFieldElement.GROUP_NONE);
} else {
mappingField.setFetchGroup(MappingFieldElement.GROUP_DEFAULT);
}
return mappingField;
}
Aggregations