Commit a545828e authored by Matija Obreza's avatar Matija Obreza

PDCI included in ES, aspects pick up recalculations

parent 282efc81
......@@ -89,6 +89,7 @@ public class AccessionDetails {
private Date modifiedDate;
private Date acqusitionDate;
private Float pdciScore;
private boolean historic;
......@@ -122,7 +123,12 @@ public class AccessionDetails {
ad.sampStat = accession.getSampleStatus();
ad.storage = new ArrayList<Integer>(accession.getStoRage());
ad.lists = new HashSet<String>();
ad.cropName=accession.getCropName();
ad.cropName = accession.getCropName();
if (accession.getAccessionId().getPdci() != null) {
ad.pdciScore = accession.getAccessionId().getPdci().getScore();
}
for (AccessionList al : accession.getAccessionId().getLists()) {
ad.lists.add(al.getUuid().toString());
}
......@@ -501,4 +507,11 @@ public class AccessionDetails {
this.lists = lists;
}
public void setPdciScore(Float pdciScore) {
this.pdciScore = pdciScore;
}
public Float getPdciScore() {
return pdciScore;
}
}
......@@ -29,6 +29,7 @@ import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrePersist;
import javax.persistence.Table;
......@@ -37,8 +38,7 @@ import org.genesys2.server.model.VersionedAuditedModel;
import org.genesys2.server.model.impl.AccessionList;
/**
* Entity holds the assigned accession identifiers regardless of active or
* historic records.
* Entity holds the assigned accession identifiers regardless of active or historic records.
*/
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
......@@ -60,6 +60,9 @@ public class AccessionId extends VersionedAuditedModel implements IdUUID {
@JoinTable(name = "accelistitems", joinColumns = @JoinColumn(name = "acceid"), inverseJoinColumns = @JoinColumn(name = "listid"))
private Set<AccessionList> lists;
@OneToOne(mappedBy = "accession", fetch = FetchType.LAZY, optional = true, orphanRemoval = true)
private PDCI pdci;
@PrePersist
private void prepersist() {
if (uuid == null) {
......@@ -83,6 +86,11 @@ public class AccessionId extends VersionedAuditedModel implements IdUUID {
public void setLists(Set<AccessionList> lists) {
this.lists = lists;
}
public PDCI getPdci() {
return pdci;
}
//
// public List<AccessionTrait> getTraits() {
// return traits;
......
......@@ -21,6 +21,7 @@ import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Index;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.PrePersist;
......@@ -31,14 +32,14 @@ import javax.persistence.Transient;
import org.genesys2.server.model.VersionedModel;
@Entity
@Table(name = "pdci")
public class PDCI extends VersionedModel {
@Table(name = "pdci", indexes = { @Index(columnList = "score") })
public class PDCI extends VersionedModel implements AccessionRelated {
private static final long serialVersionUID = -1312366054528702261L;
public static final String[] independentItems = { "genus", "species", "spAuthor", "subTaxa", "subtAuthor", "cropName", "acqDate", "sampStat", "donorCode",
"donorNumb", "otherNumb", "duplSite", "storage", "donorName", "duplInstName", "acceUrl", "mlsStat" };
public static final String[] dependentItems = { "origCty", "collSite", "latitude", "longitude", "elevation", "collDate", "bredCode", "ancest", "collSrc",
"acceName", "collNumb", "collCode", "collName" };
public static final String[] independentItems = { "genus", "species", "spAuthor", "subTaxa", "subtAuthor", "cropName", "acqDate", "sampStat", "donorCode", "donorNumb", "otherNumb", "duplSite",
"storage", "donorName", "duplInstName", "acceUrl", "mlsStat" };
public static final String[] dependentItems = { "origCty", "collSite", "latitude", "longitude", "elevation", "collDate", "bredCode", "ancest", "collSrc", "acceName", "collNumb", "collCode",
"collName" };
@OneToOne(cascade = {}, fetch = FetchType.LAZY, optional = false)
@JoinColumn(name = "accessionId")
......@@ -86,6 +87,7 @@ public class PDCI extends VersionedModel {
this.scoreHist = (float) (Math.ceil(this.score * 2) / 2);
}
@Override
public AccessionId getAccession() {
return accession;
}
......
......@@ -16,6 +16,7 @@
package org.genesys2.server.persistence.domain;
import java.util.Collection;
import java.util.List;
import org.genesys2.server.model.genesys.AccessionId;
......@@ -28,7 +29,10 @@ public interface AccessionIdRepository extends JpaRepository<AccessionId, Long>
@Query("select aid from AccessionId aid where aid.uuid is null")
List<AccessionId> findMissingUuid(Pageable pageable);
@Query("select aid from AccessionId aid, PDCI pdci where pdci.accession=aid and pdci.score is null")
@Query("select aid from AccessionId aid left join aid.pdci pdci where pdci.score is null")
List<AccessionId> findMissingPDCI(Pageable pageable);
@Query("select aid from AccessionId aid left join aid.pdci pdci where pdci.score is null")
Collection<AccessionId> findMissingPDCI();
}
......@@ -81,4 +81,6 @@ public interface FilterConstants {
public static final String LISTS = "lists";
public static final String PDCI = "pdci";
}
......@@ -18,7 +18,6 @@ package org.genesys2.server.service;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
......@@ -261,7 +260,7 @@ public interface GenesysService {
List<PDCI> loadPDCI(List<Long> batch);
int generateMissingPDCI(int count);
List<PDCI> updatePDCI(Set<Long> ids);
PDCIStatistics statisticsPDCI(Organization organization);
......@@ -269,6 +268,6 @@ public interface GenesysService {
void regenerateAccessionSequentialNumber();
List<Accession> saveAccessionCrops(ArrayList<Long> accessionIds);
List<Accession> saveAccessionCrops(List<Long> accessionIds);
}
......@@ -120,6 +120,10 @@ public class DirectMysqlQuery {
innerJoin("crop", null, "crop.id=a.cropId");
}
if (filters.hasFilter(FilterConstants.PDCI)) {
innerJoin("pdci", null, "pdci.accessionId=a.id");
}
// if (filters.hasFilter(FilterConstants.ORGCTY_ISO3)) {
// innerJoin("country", "cty", "cty.id=a.orgCtyId");
// }
......@@ -201,6 +205,7 @@ public class DirectMysqlQuery {
createQuery(whereBuffer, "accename.name", filters.get(FilterConstants.ALIAS), params);
createQuery(whereBuffer, "col.collMissId", filters.get(FilterConstants.COLLMISSID), params);
createQuery(whereBuffer, "storage.storage", filters.get(FilterConstants.STORAGE), params);
createQuery(whereBuffer, "pdci.score", filters.get(FilterConstants.PDCI), params);
for (final AppliedFilter methodFilter : filters.methodFilters()) {
// Handle Genesys Method!
......
......@@ -77,8 +77,7 @@ public class FilterHandler {
private final ArrayList<GenesysFilter> availableFilters;
/**
* By default we exclude historic records unless the user explicitly
* specifies otherwise.
* By default we exclude historic records unless the user explicitly specifies otherwise.
*/
public static final AppliedFilter NON_HISTORIC_FILTER = new AppliedFilter().setFilterName(FilterConstants.HISTORIC).addFilterValue(new LiteralValueFilter(false));
......@@ -89,8 +88,8 @@ public class FilterHandler {
this.availableFilters.add(new BasicFilter(FilterConstants.CROPNAME, DataType.STRING));
this.availableFilters.add(new BasicFilter(FilterConstants.LISTS, DataType.STRING));
this.availableFilters.add(new I18nListFilter<Integer>(FilterConstants.SAMPSTAT, DataType.NUMERIC).build("accession.sampleStatus", new Integer[] { 100,
110, 120, 130, 200, 300, 400, 410, 411, 412, 413, 414, 415, 416, 420, 421, 422, 423, 500, 600, 999 }));
this.availableFilters.add(new I18nListFilter<Integer>(FilterConstants.SAMPSTAT, DataType.NUMERIC).build("accession.sampleStatus",
new Integer[] { 100, 110, 120, 130, 200, 300, 400, 410, 411, 412, 413, 414, 415, 416, 420, 421, 422, 423, 500, 600, 999 }));
this.availableFilters.add(new AutocompleteFilter(FilterConstants.TAXONOMY_GENUS, "/explore/ac/" + FilterConstants.TAXONOMY_GENUS));
this.availableFilters.add(new AutocompleteFilter(FilterConstants.TAXONOMY_SPECIES, "/explore/ac/" + FilterConstants.TAXONOMY_SPECIES));
this.availableFilters.add(new AutocompleteFilter(FilterConstants.TAXONOMY_SUBTAXA, "/explore/ac/" + FilterConstants.TAXONOMY_SUBTAXA));
......@@ -113,8 +112,8 @@ public class FilterHandler {
this.availableFilters.add(new BasicFilter(FilterConstants.AVAILABLE, DataType.BOOLEAN));
this.availableFilters.add(new BasicFilter(FilterConstants.HISTORIC, DataType.BOOLEAN).allowsNull(false));
this.availableFilters.add(new BasicFilter(FilterConstants.COLLMISSID, DataType.STRING).setAnalyzed(true));
this.availableFilters.add(new I18nListFilter<Integer>(FilterConstants.STORAGE, DataType.NUMERIC).build("accession.storage", new Integer[] { 10, 11, 12,
13, 20, 30, 40, 50, 99 }));
this.availableFilters.add(new I18nListFilter<Integer>(FilterConstants.STORAGE, DataType.NUMERIC).build("accession.storage", new Integer[] { 10, 11, 12, 13, 20, 30, 40, 50, 99 }));
this.availableFilters.add(new BasicFilter(FilterConstants.PDCI, DataType.NUMERIC).allowsNull(false));
}
public List<GenesysFilter> listAvailableFilters() {
......@@ -378,8 +377,7 @@ public class FilterHandler {
}
/**
* Returns true if the filter is listed and has at least one value
* specified
* Returns true if the filter is listed and has at least one value specified
*
* @param filterName
* @return
......@@ -751,7 +749,7 @@ public class FilterHandler {
public String toString() {
return getClass().getSimpleName() + " " + getType() + ": " + getTo();
}
@Override
public int hashCode() {
final int prime = 31;
......@@ -809,13 +807,11 @@ public class FilterHandler {
return from;
}
@Override
public String toString() {
return getClass().getSimpleName() + " " + getType() + ": " + getFrom();
}
@Override
public int hashCode() {
final int prime = 31;
......@@ -873,7 +869,7 @@ public class FilterHandler {
public String toString() {
return getClass().getSimpleName() + " startsWith " + getStartsWith();
}
@Override
public int hashCode() {
final int prime = 31;
......
......@@ -32,6 +32,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
......@@ -287,8 +288,7 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
} else {
try {
Accession accnByAlias = accessionAliasRepository.findAccession(aid3.getHoldingInstitute(), aid3.getAccessionName(),
AccessionAlias.AliasType.OTHERNUMB.getId());
Accession accnByAlias = accessionAliasRepository.findAccession(aid3.getHoldingInstitute(), aid3.getAccessionName(), AccessionAlias.AliasType.OTHERNUMB.getId());
if (accnByAlias != null) {
LOG.info("Found accession by alias " + accnByAlias);
......@@ -506,71 +506,83 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
@Override
public List<AllStuff> loadAllStuff(Collection<Long> accessionIds) {
List<AllStuff> alls = new ArrayList<AllStuff>(accessionIds.size());
if (accessionIds == null || accessionIds.size() == 0) {
return alls;
return Collections.emptyList();
}
HashMap<Long, AllStuff> map = new HashMap<Long, AllStuff>();
for (Long accessionId : accessionIds) {
AllStuff all = new AllStuff(accessionId);
alls.add(all);
map.put(accessionId, all);
}
for (AccessionData a : accessionRepository.findAll(accessionIds)) {
final Map<Long, AllStuff> map = Collections.synchronizedMap(new HashMap<Long, AllStuff>());
List<AllStuff> alls = accessionIds.stream().map(accessionId -> new AllStuff(accessionId)).peek(all -> map.put(all.id, all)).collect(Collectors.toList());
accessionRepository.findAll(accessionIds).stream().forEach(a -> {
AllStuff all = map.get(a.getAccessionId().getId());
all.accession = a;
a.getAccessionId().getLists().size();
// Don't use a#getStorage()
a.getStoRage().size();
all.names = new ArrayList<AccessionAlias>();
all.remarks = new ArrayList<AccessionRemark>();
}
if (a.getAccessionId().getLists() != null)
a.getAccessionId().getLists().size();
if (a.getStoRage() != null)
// Lazy load stoRage
a.getStoRage().size();
all.names = new ArrayList<>();
all.remarks = new ArrayList<>();
});
accessionHistoricRepository.findAll(accessionIds).stream().forEach(a -> {
AllStuff all = map.get(a.getAccessionId().getId());
all.accession = a;
if (a.getAccessionId().getLists() != null)
// Lazy load lists
a.getAccessionId().getLists().size();
if (a.getStoRage() != null)
// Lazy load stoRage
a.getStoRage().size();
all.names = new ArrayList<>();
all.remarks = new ArrayList<>();
});
for (AccessionCollect c : accessionCollectRepository.findAllFor(accessionIds)) {
accessionCollectRepository.findAllFor(accessionIds).stream().forEach(c -> {
AllStuff all = map.get(c.getAccession().getId());
all.collect = c;
}
});
for (AccessionGeo g : accessionGeoRepository.findAllFor(accessionIds)) {
accessionGeoRepository.findAllFor(accessionIds).stream().forEach(g -> {
AllStuff all = map.get(g.getAccession().getId());
all.geo = g;
}
});
for (AccessionBreeding b : accessionBreedingRepository.findAllFor(accessionIds)) {
accessionBreedingRepository.findAllFor(accessionIds).stream().forEach(b -> {
AllStuff all = map.get(b.getAccession().getId());
all.bred = b;
}
});
for (AccessionExchange e : accessionExchangeRepository.findAllFor(accessionIds)) {
accessionExchangeRepository.findAllFor(accessionIds).stream().forEach(e -> {
AllStuff all = map.get(e.getAccession().getId());
all.exch = e;
}
});
for (SvalbardData e : svalbardRepository.findAllFor(accessionIds)) {
AllStuff all = map.get(e.getId());
all.svalbard = e;
}
svalbardRepository.findAllFor(accessionIds).stream().forEach(sd -> {
AllStuff all = map.get(sd.getId());
all.svalbard = sd;
});
for (AccessionAlias aa : accessionAliasRepository.findAllFor(accessionIds)) {
accessionAliasRepository.findAllFor(accessionIds).stream().forEach(aa -> {
if (aa == null) {
System.err.println("aa is null");
continue;
LOG.warn("aa is null");
return;
}
AllStuff all = map.get(aa.getAccession().getId());
if (all == null) {
System.err.println(aa.getAccession().getId() + " not in the list! " + aa);
LOG.warn(aa.getAccession().getId() + " not in the list! " + aa);
} else {
all.names.add(aa);
}
}
});
for (AccessionRemark ar : accessionRemarkRepository.findAllFor(accessionIds)) {
accessionRemarkRepository.findAllFor(accessionIds).stream().forEach(ar -> {
AllStuff all = map.get(ar.getAccession().getId());
all.remarks.add(ar);
}
});
for (AllStuff all : alls) {
alls.stream().forEach(all -> {
detach(all.accession);
detach(all.geo);
detach(all.collect);
......@@ -578,7 +590,7 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
detach(all.names);
detach(all.exch);
detach(all.remarks);
}
});
return alls;
}
......@@ -674,7 +686,7 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
public Page<Object[]> statisticsCropNameByInstitute(FaoInstitute institute, Pageable pageable) {
return accessionRepository.statisticsCropNameInInstitute(institute, pageable);
}
@Override
public Page<Object[]> statisticsGenusByInstitute(FaoInstitute institute, Pageable pageable) {
return accessionRepository.statisticsGenusInInstitute(institute, pageable);
......@@ -796,7 +808,8 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
public List<Accession> saveAccessions(Iterable<Accession> accessions) {
Set<FaoInstitute> institutes = new HashSet<FaoInstitute>();
for (Accession accession : accessions) {
// System.out.println("Saving " + accession + " STO=" + accession.getStoRage() + " ST=" + accession.getStorage());
// System.out.println("Saving " + accession + " STO=" + accession.getStoRage() + " ST=" +
// accession.getStorage());
institutes.add(accession.getInstitute());
}
List<Accession> res = accessionRepository.save(accessions);
......@@ -1214,8 +1227,8 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
private void writeAccessionsCore(final AppliedFilters filters, ZipOutputStream zos) throws IOException {
@SuppressWarnings("resource")
final CSVWriter csv = new CSVWriter(new BufferedWriter(new OutputStreamWriter(zos)), ',', '"', '\\', "\n");
csv.writeNext(new String[] { "genesysId", "uuid", "instCode", "acceNumb", "genus", "species", "fullTaxa", "orgCty", "acqSrc", "acqDate", "mlsStat",
"available", "historic", "storage", "sampStat", "duplSite", "createdBy", "createdDate", "lastModifiedBy", "lastModifiedDate" });
csv.writeNext(new String[] { "genesysId", "uuid", "instCode", "acceNumb", "genus", "species", "fullTaxa", "orgCty", "acqSrc", "acqDate", "mlsStat", "available", "historic", "storage",
"sampStat", "duplSite", "createdBy", "createdDate", "lastModifiedBy", "lastModifiedDate" });
final ResultSetHelper csvResultsetHelper = new CSVResultSetHelper();
......@@ -1305,8 +1318,7 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
private void writeAccessionsColl(final AppliedFilters filters, ZipOutputStream zos) throws IOException {
@SuppressWarnings("resource")
final CSVWriter csv = new CSVWriter(new BufferedWriter(new OutputStreamWriter(zos)), ',', '"', '\\', "\n");
csv.writeNext(new String[] { "genesysId", "collMissId", "collNumb", "collDate", "collSrc", "collSite", "collCode", "collName", "collInstAddress",
"version" });
csv.writeNext(new String[] { "genesysId", "collMissId", "collNumb", "collDate", "collSrc", "collSite", "collCode", "collName", "collInstAddress", "version" });
final ResultSetHelper csvResultsetHelper = new ResultSetHelperService();
......@@ -1399,8 +1411,7 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
for (int i = 0; i < metadataMethods.size(); i++) {
final Method method = metadataMethods.get(i);
osw.write(
"<extension encoding=\"UTF-8\" fieldsTerminatedBy=\",\" linesTerminatedBy=\"\\n\" fieldsEnclosedBy=\"&quot;\" ignoreHeaderLines=\"0\">\n");
osw.write("<extension encoding=\"UTF-8\" fieldsTerminatedBy=\",\" linesTerminatedBy=\"\\n\" fieldsEnclosedBy=\"&quot;\" ignoreHeaderLines=\"0\">\n");
osw.write("\t<files><location>");
osw.write(method.getFieldName().toLowerCase());
osw.write(".csv</location></files>\n");
......@@ -1632,31 +1643,23 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
@Override
@Transactional
@CacheEvict(value = "statistics", allEntries = true)
public int generateMissingPDCI(int count) {
List<AccessionId> accessionIds = accessionIdRepository.findMissingPDCI(new PageRequest(0, count));
Set<Long> ids = new HashSet<Long>();
for (AccessionId id : accessionIds) {
if (id != null) {
ids.add(id.getId());
}
}
Collection<AccessionDetails> ads = getAccessionDetails(ids);
List<PDCI> pdcis = new ArrayList<PDCI>();
for (AccessionDetails ad : ads) {
PDCI pdci = new PDCI();
AccessionId accessionId = null;
for (AccessionId id : accessionIds) {
if (id.getId().equals(ad.getId())) {
accessionId = id;
}
public List<PDCI> updatePDCI(final Set<Long> ids) {
LOG.info("Calculating PDCI for " + ids.size() + " accessions");
final List<PDCI> pdcis = Collections.synchronizedList(new ArrayList<PDCI>(ids.size()));
getAccessionDetails(ids).stream().forEach(ad -> {
PDCI pdci = repoPdci.findByAccessionId(ad.getId());
if (pdci == null) {
pdci = new PDCI();
pdci.setAccession(accessionIdRepository.findOne(ad.getId()));
}
pdci.setAccession(accessionId);
pdciCalculator.updatePdci(pdci, ad);
pdcis.add(pdci);
}
LOG.info("Generated " + accessionIds.size() + " new PDCIs");
});
LOG.info("Generated " + pdcis.size() + " new PDCIs");
repoPdci.save(pdcis);
return pdcis.size();
return pdcis;
}
@Override
......@@ -1794,11 +1797,10 @@ public class GenesysServiceImpl implements GenesysService, DatasetService {
genesysLowlevelRepository.updateAccessionSequentialNumber(batch);
}
@Override
@Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW)
// @PreAuthorize("hasRole('ADMINISTRATOR')")
public List<Accession> saveAccessionCrops(ArrayList<Long> accessionIds) {
public List<Accession> saveAccessionCrops(List<Long> accessionIds) {
List<Accession> accessions = new ArrayList<>(accessionRepository.findAll(accessionIds));
for (Accession accession : accessions) {
accessionRepository.updateCrop(accession, cropService.getCrop(accession.getCropName()));
......
......@@ -16,12 +16,27 @@
package org.genesys2.server.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.genesys2.server.model.genesys.*;
import org.genesys2.server.model.genesys.AccessionId;
import org.genesys2.server.model.genesys.Metadata;
import org.genesys2.server.model.genesys.Method;
import org.genesys2.server.model.genesys.Parameter;
import org.genesys2.server.model.genesys.ParameterCategory;
import org.genesys2.server.model.impl.Crop;
import org.genesys2.server.persistence.domain.*;
import org.genesys2.server.persistence.domain.AccessionTraitRepository;
import org.genesys2.server.persistence.domain.GenesysLowlevelRepository;
import org.genesys2.server.persistence.domain.MetadataMethodRepository;
import org.genesys2.server.persistence.domain.MethodRepository;
import org.genesys2.server.persistence.domain.ParameterCategoryRepository;
import org.genesys2.server.persistence.domain.ParameterRepository;
import org.genesys2.server.persistence.domain.TraitValueRepository;
import org.genesys2.server.security.AuthUserDetails;
import org.genesys2.server.service.AclService;
import org.genesys2.server.service.HtmlSanitizer;
......@@ -39,18 +54,13 @@ import org.springframework.security.acls.domain.BasePermission;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
@Transactional(readOnly = true)
public class TraitServiceImpl implements TraitService {
public static final Log LOG = LogFactory.getLog(GenesysServiceImpl.class);
@Autowired
@Qualifier("genesysLowlevelRepositoryCustomImpl")
@Qualifier("genesysLowlevelRepositoryCustomImpl")
private GenesysLowlevelRepository genesysLowlevelRepository;
@Autowired
private AclService aclService;
......@@ -68,8 +78,6 @@ public class TraitServiceImpl implements TraitService {
@Autowired
private AccessionTraitRepository accessionTraitRepository;
@Autowired
private MetadataRepository metadataRepository;
@Autowired
private MetadataMethodRepository metadataMethodRepository;
@Override
......@@ -205,8 +213,7 @@ public class TraitServiceImpl implements TraitService {
@Override
@PreAuthorize("isAuthenticated()")
@Transactional(readOnly = false)
public Method addMethod(String rdfUri, String description, String i18n, String unit, String fieldName, int fieldType, Integer fieldSize, String options,
String range, Parameter parameter) {
public Method addMethod(String rdfUri, String description, String i18n, String unit, String fieldName, int fieldType, Integer fieldSize, String options, String range, Parameter parameter) {