1 package org.apache.torque.engine.platform; 2 3 18 19 import org.apache.torque.engine.database.model.Domain; 20 import org.apache.torque.engine.database.model.SchemaType; 21 22 28 public class PlatformMysqlImpl extends PlatformDefaultImpl 29 { 30 33 public PlatformMysqlImpl() 34 { 35 super(); 36 initialize(); 37 } 38 39 42 private void initialize() 43 { 44 setSchemaDomainMapping(new Domain(SchemaType.NUMERIC, "DECIMAL")); 45 setSchemaDomainMapping(new Domain(SchemaType.INTEGER, "MEDIUMINT")); 46 setSchemaDomainMapping(new Domain(SchemaType.LONGVARCHAR, "MEDIUMTEXT")); 47 setSchemaDomainMapping(new Domain(SchemaType.DATE, "DATETIME")); 48 setSchemaDomainMapping(new Domain(SchemaType.BINARY, "BLOB")); 49 setSchemaDomainMapping(new Domain(SchemaType.VARBINARY, "MEDIUMBLOB")); 50 setSchemaDomainMapping(new Domain(SchemaType.LONGVARBINARY, "LONGBLOB")); 51 setSchemaDomainMapping(new Domain(SchemaType.BLOB, "LONGBLOB")); 52 setSchemaDomainMapping(new Domain(SchemaType.CLOB, "LONGTEXT")); 53 } 54 55 58 public String getAutoIncrement() 59 { 60 return "AUTO_INCREMENT"; 61 } 62 63 66 public boolean hasSize(String sqlType) { 67 return !("MEDIUMTEXT".equals(sqlType) || "LONGTEXT".equals(sqlType) 68 || "BLOB".equals(sqlType) || "MEDIUMBLOB".equals(sqlType) 69 || "LONGBLOB".equals(sqlType)); 70 } 71 } 72 | Popular Tags |