1 30 31 32 package org.hsqldb.util; 33 34 import java.sql.ResultSet ; 35 import java.sql.ResultSetMetaData ; 36 import java.sql.SQLException ; 37 38 44 class McKoiTransferHelper extends TransferHelper { 45 46 McKoiTransferHelper() { 47 super(); 48 } 49 50 String fixupColumnDefRead(TransferTable t, ResultSetMetaData meta, 51 String columnType, ResultSet columnDesc, 52 int columnIndex) throws SQLException { 53 54 String CompareString = "UNIQUEKEY(\'" + t.Stmts.sDestTable + "\'"; 55 56 if (columnType.indexOf(CompareString) > 0) { 57 58 columnType = "SERIAL"; 60 } 61 62 return (columnType); 63 } 64 65 public McKoiTransferHelper(TransferDb database, Traceable t, String q) { 66 super(database, t, q); 67 } 68 69 String fixupColumnDefWrite(TransferTable t, ResultSetMetaData meta, 70 String columnType, ResultSet columnDesc, 71 int columnIndex) throws SQLException { 72 73 if (columnType.equals("SERIAL")) { 74 columnType = "INTEGER DEFAULT UNIQUEKEY (\'" 75 + t.Stmts.sSourceTable + "\')"; 76 } 77 78 return (columnType); 79 } 80 81 boolean needTransferTransaction() { 82 return (true); 83 } 84 } 85 | Popular Tags |