Revision 33f93632
Added by Andreas Müller about 1 year ago
app-import/src/main/java/eu/etaxonomy/cdm/io/berlinModel/in/BerlinModelUserImport.java | ||
---|---|---|
24 | 24 |
import eu.etaxonomy.cdm.config.Configuration; |
25 | 25 |
import eu.etaxonomy.cdm.io.berlinModel.in.validation.BerlinModelUserImportValidator; |
26 | 26 |
import eu.etaxonomy.cdm.io.common.IOValidator; |
27 |
import eu.etaxonomy.cdm.io.common.ImportHelper; |
|
28 | 27 |
import eu.etaxonomy.cdm.io.common.ResultSetPartitioner; |
29 | 28 |
import eu.etaxonomy.cdm.io.common.Source; |
30 | 29 |
import eu.etaxonomy.cdm.model.agent.Person; |
... | ... | |
64 | 63 |
BerlinModelImportConfigurator config = state.getConfig(); |
65 | 64 |
Source source = config.getSource(); |
66 | 65 |
String dbAttrName; |
67 |
String cdmAttrName; |
|
68 | 66 |
|
69 | 67 |
logger.info("start make "+pluralString+" ..."); |
70 | 68 |
|
... | ... | |
100 | 98 |
dbAttrName = "RealName"; |
101 | 99 |
String realName = rs.getString(dbAttrName); |
102 | 100 |
if (isNotBlank(realName)){ |
103 |
cdmAttrName = "TitleCache"; |
|
104 | 101 |
Person person = Person.NewInstance(); |
105 |
success &= ImportHelper.addStringValue(rs, person, dbAttrName, cdmAttrName, false); |
|
106 |
//only to make deduplication work, due to issue that nomenclaturalTitle does not match because set automatically during save |
|
107 |
cdmAttrName = "nomenclaturalTitle"; |
|
108 |
success &= ImportHelper.addStringValue(rs, person, dbAttrName, cdmAttrName, false); |
|
102 |
person.setTitleCache(realName, true); |
|
109 | 103 |
|
110 | 104 |
Person dedupPerson = deduplicatePerson(state, person); |
111 | 105 |
if (dedupPerson != person){ |
... | ... | |
144 | 138 |
|
145 | 139 |
this.commitTransaction(tx); |
146 | 140 |
|
147 |
logger.info("end make "+pluralString+" ..." + getSuccessString(success));;
|
|
141 |
logger.info("end make "+pluralString+" ..." + getSuccessString(success)); |
|
148 | 142 |
if (!success){ |
149 | 143 |
state.setUnsuccessfull(); |
150 | 144 |
} |
Also available in: Unified diff
fix person titleCache handling in BerlinModel import