Project

General

Profile

Revision b67a18ce

IDb67a18cef6ccc81be6613603a2e1db4ba600e0b8
Parent a1625f28
Child 65006620

Added by Andreas Müller about 7 years ago

set termType term updater to literals

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/SingleTermUpdater.java
129 129
		String titleCache = label != null ? label : (abbrev != null ? abbrev : description );
130 130
		String idInVocStr = idInVocabulary == null ? "NULL" : "'" + idInVocabulary + "'";
131 131
		String sqlInsertTerm = " INSERT INTO DefinedTermBase (DTYPE, id, uuid, created, termtype, idInVocabulary, protectedtitlecache, titleCache, orderindex, defaultcolor, vocabulary_id)" +
132
				"VALUES ('" + dtype + "', " + id + ", '" + uuidTerm + "', '" + created + "', " + termType.ordinal() + ", " + idInVocStr +  ", " + protectedTitleCache + ", '" + titleCache + "', " + orderIndex + ", " + defaultColor + ", " + vocId + ")"; 
132
				"VALUES ('" + dtype + "', " + id + ", '" + uuidTerm + "', '" + created + "', " + termType.getKey() + ", " + idInVocStr +  ", " + protectedTitleCache + ", '" + titleCache + "', " + orderIndex + ", " + defaultColor + ", " + vocId + ")"; 
133 133
		datasource.executeUpdate(sqlInsertTerm);
134 134
		
135 135
		updateFeatureTerms(termId, datasource, monitor);
......
220 220
	private void updateRanks(Integer termId, ICdmDataSource datasource, IProgressMonitor monitor) throws SQLException {
221 221
		if (dtype.equals(Rank.class.getSimpleName())){
222 222
			String sqlUpdate = "UPDATE DefinedTermBase SET " + 
223
				" termType = " + rankClass.ordinal() +  
223
				" termType = " + rankClass.getKey() +  
224 224
				" WHERE id = " + termId;
225 225
			datasource.executeUpdate(sqlUpdate);
226 226
		}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)