Search in sources :

Example 1 with MappingFieldElementImpl

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;
}
Also used : MappingFieldElement(com.sun.jdo.api.persistence.model.mapping.MappingFieldElement) MappingFieldElementImpl(com.sun.jdo.api.persistence.model.mapping.impl.MappingFieldElementImpl)

Aggregations

MappingFieldElement (com.sun.jdo.api.persistence.model.mapping.MappingFieldElement)1 MappingFieldElementImpl (com.sun.jdo.api.persistence.model.mapping.impl.MappingFieldElementImpl)1