package org.miabis.converter.batch;

import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.item.file.transform.FieldSet;
import org.springframework.validation.BindException;

import eu.bbmri_eric.miabis.Biobank;

public class BioBankFieldSetMapper implements FieldSetMapper<Biobank>{

	@Override
	public Biobank mapFieldSet(FieldSet fieldSet) throws BindException {
		Biobank bBank = new Biobank();
		bBank.setId(fieldSet.readString(0));
		bBank.setName(fieldSet.readString(1));
		bBank.setAcronym(fieldSet.readString(2));
		bBank.setUrl(fieldSet.readString(3));
		bBank.setDescription(fieldSet.readString(4));
		bBank.setJuristicPerson(fieldSet.readString(5));
		
		//fieldSet.readString("id");
		
		return bBank;
	}

}

@@ -30,16 +30,59 @@
 batch;%0A%0A
+import org.miabis.exchange.schema.Biobank;%0A
 import o
@@ -261,46 +261,8 @@
 n;%0A%0A
-import eu.bbmri_eric.miabis.Biobank;%0A%0A
 publ
@@ -659,59 +659,8 @@
 ));%0A
-%09%09bBank.setJuristicPerson(fieldSet.readString(5));%0A
 %09%09%0A%09

complete biobank mapping