32 lines
1.4 KiB
Java
32 lines
1.4 KiB
Java
package eu.eudat.model.builder.descriptiontemplatedefinition.fielddata;
|
|
|
|
import eu.eudat.commons.types.descriptiontemplate.fielddata.ReferenceTypeDataEntity;
|
|
import eu.eudat.convention.ConventionService;
|
|
import eu.eudat.model.descriptiontemplatedefinition.fielddata.ReferenceTypeData;
|
|
import gr.cite.tools.fieldset.FieldSet;
|
|
import gr.cite.tools.logging.LoggerService;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
|
import org.springframework.context.annotation.Scope;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
@Component
|
|
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
|
public class ReferenceTypeDataBuilder extends BaseFieldDataBuilder<ReferenceTypeData, ReferenceTypeDataEntity> {
|
|
|
|
@Autowired
|
|
public ReferenceTypeDataBuilder(ConventionService conventionService) {
|
|
super(conventionService, new LoggerService(LoggerFactory.getLogger(ReferenceTypeDataBuilder.class)));
|
|
}
|
|
|
|
protected ReferenceTypeData getInstance() {
|
|
return new ReferenceTypeData();
|
|
}
|
|
@Override
|
|
protected void buildChild(FieldSet fields, ReferenceTypeDataEntity d, ReferenceTypeData m) {
|
|
if (fields.hasField(this.asIndexer(ReferenceTypeData._multipleSelect))) m.setMultipleSelect(d.getMultipleSelect());
|
|
if (fields.hasField(this.asIndexer(ReferenceTypeData._referenceTypeId))) m.setReferenceTypeId(d.getReferenceTypeId());
|
|
}
|
|
}
|