1 19 20 package org.apache.cayenne.dba.hsqldb; 21 22 import org.apache.cayenne.map.DbEntity; 23 24 25 31 public class HSQLDBNoSchemaAdapter extends HSQLDBAdapter { 32 37 protected String getTableName(DbEntity entity) 38 { 39 return entity.getName(); 40 } 41 42 47 protected String getSchemaName(DbEntity entity) { 48 return ""; 49 } 50 51 56 public String dropTable(DbEntity ent) { 57 return "DROP TABLE " + getTableName(ent); 59 } 60 61 66 public String createTable(DbEntity ent) { 67 String sql = super.createTable(ent); 68 69 String fqnCreate = "CREATE CACHED TABLE " + super.getTableName(ent) + " ("; 71 if (sql != null && sql.toUpperCase().startsWith(fqnCreate)) { 72 sql = "CREATE CACHED TABLE " 73 + getTableName(ent) 74 + " (" 75 + sql.substring(fqnCreate.length()); 76 } 77 78 return sql; 79 } 80 } 81 | Popular Tags |