Index: trunk/WikiWord/WikiWord/src/main/java/de/brightbyte/wikiword/schema/LocalConceptStoreSchema.java |
— | — | @@ -74,6 +74,7 @@ |
75 | 75 | |
76 | 76 | definitionTable = new EntityTable(this, "definition", defaultTableAttributes); |
77 | 77 | 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 ) ); |
78 | 79 | definitionTable.addField( new DatabaseField(this, "definition", getTextType(1024*8), null, true, null ) ); |
79 | 80 | definitionTable.setAutomaticField(null); |
80 | 81 | addTable(definitionTable); |
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseLocalConceptStoreBuilder.java |
— | — | @@ -198,7 +198,7 @@ |
199 | 199 | |
200 | 200 | |
201 | 201 | protected void deleteDataFrom(int rcId, String op) throws PersistenceException { |
202 | | - deleteDataFrom(rcId, op, definitionTable, "concept", aboutTable, "concept", "resource"); |
| 202 | + deleteDataFrom(rcId, op, definitionTable, "resource"); |
203 | 203 | |
204 | 204 | deleteDataFrom(rcId, op, linkTable, "resource"); |
205 | 205 | deleteDataFrom(rcId, op, langlinkTable, "resource"); |
— | — | @@ -248,6 +248,7 @@ |
249 | 249 | try { |
250 | 250 | if (conceptId<0) throw new IllegalArgumentException("bad concept id "+conceptId); |
251 | 251 | |
| 252 | + definitionInserter.updateInt("resource", rcId); |
252 | 253 | definitionInserter.updateInt("concept", conceptId); |
253 | 254 | definitionInserter.updateString("definition", clipString(rcId, definition, 1024 * 8, "definition text (concept {0})", conceptId)); |
254 | 255 | definitionInserter.updateRow(); |