r48632 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48631‎ | r48632 | r48633 >
Date:13:27, 20 March 2009
Author:daniel
Status:deferred
Tags:
Comment:
include resource id in definition
Modified paths:
  • /trunk/WikiWord/WikiWord/src/main/java/de/brightbyte/wikiword/schema/LocalConceptStoreSchema.java (modified) (history)
  • /trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseLocalConceptStoreBuilder.java (modified) (history)

Diff [purge]

Index: trunk/WikiWord/WikiWord/src/main/java/de/brightbyte/wikiword/schema/LocalConceptStoreSchema.java
@@ -74,6 +74,7 @@
7575
7676 definitionTable = new EntityTable(this, "definition", defaultTableAttributes);
7777 definitionTable.addField( new ReferenceField(this, "concept", "INT", null, true, KeyType.PRIMARY, "concept", "id", null ) );
 78+ definitionTable.addField( new ReferenceField(this, "resource", "INT", null, true, KeyType.UNIQUE, "resource", "id", null ) );
7879 definitionTable.addField( new DatabaseField(this, "definition", getTextType(1024*8), null, true, null ) );
7980 definitionTable.setAutomaticField(null);
8081 addTable(definitionTable);
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseLocalConceptStoreBuilder.java
@@ -198,7 +198,7 @@
199199
200200
201201 protected void deleteDataFrom(int rcId, String op) throws PersistenceException {
202 - deleteDataFrom(rcId, op, definitionTable, "concept", aboutTable, "concept", "resource");
 202+ deleteDataFrom(rcId, op, definitionTable, "resource");
203203
204204 deleteDataFrom(rcId, op, linkTable, "resource");
205205 deleteDataFrom(rcId, op, langlinkTable, "resource");
@@ -248,6 +248,7 @@
249249 try {
250250 if (conceptId<0) throw new IllegalArgumentException("bad concept id "+conceptId);
251251
 252+ definitionInserter.updateInt("resource", rcId);
252253 definitionInserter.updateInt("concept", conceptId);
253254 definitionInserter.updateString("definition", clipString(rcId, definition, 1024 * 8, "definition text (concept {0})", conceptId));
254255 definitionInserter.updateRow();

Status & tagging log