Index: trunk/WikiWord/WikiWord/src/main/java/de/brightbyte/wikiword/store/DatabaseWikiWordStore.java |
— | — | @@ -176,6 +176,14 @@ |
177 | 177 | throw new PersistenceException(e); |
178 | 178 | } |
179 | 179 | } |
| 180 | + |
| 181 | + protected ResultSet executeBigQuery(String name, String sql) throws PersistenceException { |
| 182 | + try { |
| 183 | + return database.executeBigQuery(name, sql); |
| 184 | + } catch (SQLException e) { |
| 185 | + throw new PersistenceException(e); |
| 186 | + } |
| 187 | + } |
180 | 188 | |
181 | 189 | /* |
182 | 190 | protected ResultSet executeBigQuery(String name, String sql) throws PersistenceException { |
Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseLocalConceptStoreBuilder.java |
— | — | @@ -22,8 +22,10 @@ |
23 | 23 | import de.brightbyte.db.DatabaseDataSet; |
24 | 24 | import de.brightbyte.db.DatabaseField; |
25 | 25 | import de.brightbyte.db.DatabaseTable; |
| 26 | +import de.brightbyte.db.DatabaseUtil; |
26 | 27 | import de.brightbyte.db.EntityTable; |
27 | 28 | import de.brightbyte.db.Inserter; |
| 29 | +import de.brightbyte.db.MySqlDialect; |
28 | 30 | import de.brightbyte.db.ReferenceField; |
29 | 31 | import de.brightbyte.db.RelationTable; |
30 | 32 | import de.brightbyte.util.PersistenceException; |
— | — | @@ -192,12 +194,17 @@ |
193 | 195 | } |
194 | 196 | |
195 | 197 | protected DataCursor<Pair<String, Integer>> getConceptIdCursor() throws PersistenceException { |
| 198 | + final boolean binaryText = database.getHints().getHint(MySqlDialect.HINT_USE_BINARY_TEXT, false); |
| 199 | + |
196 | 200 | String sql = "SELECT name, id from " + conceptTable.getSQLName(); |
197 | | - ResultSet rs = executeQuery("getConceptIdCursor", sql); |
| 201 | + ResultSet rs = executeBigQuery("getConceptIdCursor", sql); |
198 | 202 | |
199 | 203 | DatabaseDataSet.Factory<Pair<String, Integer>> f = new DatabaseDataSet.Factory<Pair<String, Integer>>() { |
200 | 204 | public Pair<String, Integer> newInstance(ResultSet row) throws Exception { |
201 | | - return new Pair<String, Integer>(row.getString(1), row.getInt(2)); |
| 205 | + Object n = binaryText ? row.getBytes(1) : row.getString(1); |
| 206 | + String name = DatabaseUtil.asString(n, "UTF-8"); |
| 207 | + int id = DatabaseUtil.asInt(row.getObject(2)); |
| 208 | + return new Pair<String, Integer>(name, id); |
202 | 209 | } |
203 | 210 | }; |
204 | 211 | |