01: package org.openrdf.sail.rdbms.mysql;
02:
03: import java.sql.SQLException;
04:
05: import org.openrdf.sail.rdbms.schema.RdbmsTable;
06:
07: public class MySqlTable extends RdbmsTable {
08:
09: public MySqlTable(String name) {
10: super (name);
11: }
12:
13: @Override
14: protected String buildCreateTransactionalTable(CharSequence columns) {
15: StringBuilder sb = new StringBuilder();
16: sb.append("CREATE TABLE ").append(getName());
17: sb.append(" (\n").append(columns).append(")");
18: sb.append(" type = InnoDB");
19: return sb.toString();
20: }
21:
22: @Override
23: protected String buildLongIndex(String... columns) {
24: StringBuilder sb = new StringBuilder();
25: sb.append("CREATE INDEX ").append(buildIndexName(columns));
26: sb.append(" ON ").append(getName());
27: sb.append(" (value(1024))");
28: return sb.toString();
29: }
30:
31: @Override
32: protected String buildOptimize() throws SQLException {
33: return "OPTIMIZE TABLE " + getName();
34: }
35:
36: @Override
37: protected String buildDropIndex(String name) {
38: StringBuilder sb = new StringBuilder();
39: sb.append("DROP INDEX ").append(name);
40: sb.append(" ON ").append(getName());
41: return sb.toString();
42: }
43:
44: }
|