mpoeschl 2004/01/16 17:52:12 Modified: src/generator/src/test/org/apache/torque/engine/database/model DomainTest.java src/generator/src/java/org/apache/torque/engine/database/model Column.java Log: check for Platform.hasSize() in getSqlString() Revision Changes Path 1.9 +13 -3 db-torque/src/generator/src/test/org/apache/torque/engine/database/model/DomainTest.java Index: DomainTest.java =================================================================== RCS file: /home/cvs/db-torque/src/generator/src/test/org/apache/torque/engine/database/model/DomainTest.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- DomainTest.java 7 Dec 2003 12:47:37 -0000 1.8 +++ DomainTest.java 17 Jan 2004 01:52:11 -0000 1.9 @@ -3,7 +3,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2003 The Apache Software Foundation. All rights + * Copyright (c) 2003-2004 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -195,5 +195,15 @@ assertEquals("INTEGER", col.getDomain().getSqlType()); assertEquals("cbooleanint INTEGER ", col.getSqlString()); } - + + public void testBlob() throws Exception + { + Table table = db.getTable("types"); + Column col = table.getColumn("cblob"); + assertEquals("", col.getAutoIncrementString()); + assertEquals("BLOB", col.getTorqueType()); + assertEquals("LONGBLOB", col.getDomain().getSqlType()); + assertEquals("cblob LONGBLOB ", col.getSqlString()); + } + } 1.21 +8 -5 db-torque/src/generator/src/java/org/apache/torque/engine/database/model/Column.java Index: Column.java =================================================================== RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/database/model/Column.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- Column.java 7 Dec 2003 12:47:37 -0000 1.20 +++ Column.java 17 Jan 2004 01:52:11 -0000 1.21 @@ -3,7 +3,7 @@ /* ==================================================================== * The Apache Software License, Version 1.1 * - * Copyright (c) 2001-2003 The Apache Software Foundation. All rights + * Copyright (c) 2001-2004 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -576,7 +576,7 @@ if (type == null) { log.warn("SchemaType " + torqueType + " does not exist"); - type = this.DEFAULT_TYPE; + type = Column.DEFAULT_TYPE; } setType(type); } @@ -988,8 +988,11 @@ sb.append(getName()); sb.append(" "); sb.append(getDomain().getSqlType()); - sb.append(getDomain().printSize()); - sb.append(" "); + if (getPlatform().hasSize(getDomain().getSqlType())) + { + sb.append(getDomain().printSize()); + sb.append(" "); + } if (getDomain().getDefaultValue() != null) { sb.append("default ");
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]