Torque 3.1

Changes between Torque 3.1-rc and 3.1.

Fixed bugs

  • SqlExpression: replace UniqueList with HashSet to improve performace for large IN clause.

Torque 3.1-rc

Changes between Torque 3.1-beta1 and 3.1-rc.

Fixed bugs

  • JdbcTrasformTask: error fetching foreign keys using an ODBC source.
  • new version of village.jar fixes BOOLEANCHAR handling.
  • TRQ4: Transaction mismanagement in IDBroker.

Torque 3.1-beta1

Changes between Torque 3.1-alpha2 and 3.1-beta1.

Other changes

  • Introduced the TorqueInstance class to do away with static initialization woes and allow multiple instances of Torque per ClassLoader.
  • The generated schema-data.dtd has been changed to allow any order of table data entries.
  • The old Torque connection pool is deprecated. You should use the commons-dbcp pool.
  • Upgraded to latest commons-dbcp snapshot. The new SharedPoolDatasourceFactory is now used by default. Don't forget to upgrade your property file!

Fixed bugs

  • TRQS51: Datadump does not recognize null columns properly
  • TRQS85: Torque.initialize not reentrant
  • TRQS87: name conflict in generated java sources when using java reserved words (like "class") as column names.

    Column.UncapitalisedJavaName is now used as member name instead of Column.Name.toLowerCase()

  • TRQS136: MySQL will not accept a size definition for TEXT and BLOB fields
  • TRQS152: Oracle DB using Criteria to select by Data doesn't work
  • TRQS174: Problems on DB2 with BINARY, VARBINARY and INTEGER.
  • TRQS178: use sql autoincrement only if idMethod native.

    So you have to set idMethod="native" (table) plus autoincrement="true" (column) to generate the autoincrement code in your sql.

Torque 3.1-alpha2

Changes between Torque 3.1-alpha1 and 3.1-alpha2.

Changes that could (will) break older environments

  • TRQS2: use commons-logging.

    BaseObject.log() and .getLog() now return a Log object.

Other changes

  • The DTD resolver will now use the database.dtd from the classpath if the DTD is http://db.apache.org/torque/dtd/database_3_1.dtd.
  • LargeSelect now implements Serializable, provides better debugging information and further methods for maintaining search parameters.
  • LargeSelect is now thread safe when calling invalidateResult (thanks to Soteri Panagou <panagos@midetech.com>).
  • Updated ojb tasks to work for OJB 1.0(rc3). The generated modell is very simple. Support for advanced features will be added in the future.

Fixed bugs

  • TRQS20: mysql: "on delete cascade" not generated
  • TRQS101: Sql2Xml task should generate a dtd compliant xml
  • TRQS121: native limit and offset breaks on postgresql 7.3
  • TRQS138: NullPointer Exception When not setting the DbName explicitly
  • TRQS139: wrong invocation of populateObject in peer class
  • TRQS141: Table with no primary key results an empty ADD PRIMARY KEY ()
  • TRQS153: BasePeer.doSelect(Criteria, Connection) calls executeQuery without offset and limit.
  • TRQS159: Invalid syntaxes for Hypersonic when using indexes.
  • TRQS165: columns in an external schema caused Manager imports to be generated
  • Corrected deadly multi-CPU thread deadlock problem discovered by Ed Korthof <ed@apache.org> and John McNally <jmcnally@apache.org>. The problem was due to emulation of synchronization using an int counter (to improve performance by avoiding Java "synchronized" keyword). Post-increment and decrement operators compile to three op codes (with Sun's JDK 1.3.1 for Linux), unsafe on a multi-CPU box.

Torque 3.1-alpha1

Changes between Torque 3.0 and 3.1-alpha1.

Changes that could (will) break older environments

  • Removed all deprecated stuff from the java code. Make sure to not get any deprecation warnings before you switch to 3.1!
  • The generator was separated. The docs for the generator can be found here
  • TRQS145: Replace StringStack as it is deprecated. The return type for some public methods changed (but as they are only used internally you should not need to change anything in your code).

Other changes

  • TRQS95: Junit tests for sql2xml task (SQLToAppDataTest)
  • Package names for generated java classes are now handled in the model (not the templates)
  • The DTD resolver will now use the database.dtd from the classpath if the DTD is http://jakarta.apache.org/turbine/dtd/database_3_1.dtd. This change allows XML editor to use the proper version of the DTD.

Fixed bugs

  • TRQ18: Criteria.addDate is broken
  • TRQ19: recursive external schemas fail
  • TRQ47: limit and offset patch for Oracle
  • TRQD21: torque schema-reference.html bug: unique-column
  • TRQS29, TRQS93: fix endless loop in Monitor
  • TRQS35: id-table-schema.xml has no database name
  • TRQS47: bug in torque generated copy() method
  • TRQS90: SQLScanner reports wrong line numbers in Window platforms and behaves incorrectly when finding the minus sign
  • TRQS98: Documentation changes in ForeignKey.java
  • TRQS104: Use of null Object
  • TRQS116: Database.java NPEs on bad foreign key
  • TRQS118: Generated OM doesn't compile when using FLOAT as primary key
  • TRQS122: Join methods are not generated.
  • TRQS132: Database.java using null object

Torque 3.0

Changes between Torque 3.0-rc2 and 3.0.

Other changes

  • TRQS59: torque-jdbc-transform should not show password
  • TRQS86: uses @DATABASE@ variable for default database adapter instead of mysql

Fixed bugs

  • TRQS61: more concise name on Criteria.setSingleRecord
  • TRQS73: Criteria.toString() modifies the Criteria object
  • TRQS81: getPrimaryKey() throws NullPointerException is pk is Object type and null.
  • TRQS82: Constructor for DateKey and StringKey will throw NullPointer exception if passed null value
  • sql-generation: create foreign keys for hsqldb

Torque 3.0-rc2

Changes between Torque 3.0-rc1 and 3.0-rc2.

Changes that could (will) break older environments

  • TRQ2: the TorqueSQLExec task ignores lines starting with '//', '--' or 'REM ' (notice the space!!).

Other changes

  • TRQ24: added doDelete(ObjectKey) methods to the generated Peers.
  • Added a Maven plugin for executing Torque commands and updated the Maven Howto to reflect the addition.
  • Added support for MS Access (using the JDBC-ODBC Bridge driver).
  • Upgraded village to 2.0-dev.

Fixed bugs

  • TRQ37: Problem retrieving object/row count using Criteria
  • TRQD6: update README (ant 1.5 is required)
  • TRQS68: remove invalid pathelement in build-torque.xml
  • TRQS75: Object.vm generates files which will not compile.
  • TRQS77: postgres - Incosistent generation errors
  • When generating an XML schema from a SQL Schema, the output xml contains a javaname attribute (notice the lowercase "n" in javaname)
  • Doc generation (anakia format): escape characters not allowed in XML

Torque 3.0-rc1

Changes between Torque 3.0-b4 and 3.0-rc1.

Changes that could (will) break older environments

  • TRQ41: make getPrimaryKey return ObjectKey but getPkField return the type it is.
  • TRQS37: Torque 3.0 doesn't work with Intake in Turbine 2.x's Retrievable interface. Added a property torque.retrievableInterface (defaults to the turbine-2 version).

    Fulcrum users have to set the property to org.apache.fulcrum.intake.Retrievable

Other changes

  • TRQ45: Added static factory methods to create instances of SimpleKey
  • TRQS7: minor corrections for OJB template
  • TRQS13: torque.overloadKeySetters obsoleted
  • added support for the new com.mysql.jdbc.Driver
  • improved JDBC to DB2 mappings.
  • improved JDBC to SAPDB mappings (incl. TRQ35).
  • peers: do not create the JoinAll method if any of the foreign keys reference external tables.
  • new property 'torque.generateDeprecated' ( = 'true').

    if set to 'false' deprecated methods in the om/peer classes are not generated

Fixed bugs

  • TRQ44: Fix ComboKey.setValue(String) to avoid infinite loop
  • TRQ26: string to date conversion in MSSQL/Sybase
  • TRQ28: booleanint/booleanchar fails with javaType="object"
  • TRQ31: ComboKey(String) ctor out-of-memory error
  • TRQ39: Data Dump task may generate invalid XML output
  • TRQ44: add a NumberKey(Number key) constructor and added methods to get native datatypes (byte, int, long, float, double)
  • TRQ45: add static keyFor methods to generate appropriate SimpleKey instance
  • TRQS1: several small patches to correct db2 sql generation
  • TRQS15: Torque gererated code does not compile
  • TRQS33: fix foreign key generation statements for db2
  • TRQS40: id-table-init-sql creates empty .sql file
  • bugzilla #12626: Peer.vm was missing the DateKey import.
  • postgres: Unable to identify an operator '=' for types 'smallint' and 'boolean'
  • sapdb: generate valid sql for primary keys
  • objects: avoid npe and set id to null if the object was null
  • objects: the generation of the BaseClass and the Interface is working even if the Interface is empty.

Torque 3.0-b4

Changes between Torque 3.0-b3 and 3.0-b4.

Changes that could (will) break older environments

  • jdbc2pool package dissolved (the old Torque pool is back in the torque codebase, the new pool is part of commons-dbcp now)

Other changes

  • torque uses maven-1.0-beta-6 as default build system.
  • renamed all properties (torque prefix added).

    the old property names still work but they are deprecated and support will be removed after the 3.0 release.

Fixed bugs

  • aliases not recognized in orderBy column

Torque 3.0-b3

Changes between Torque 2.1 (old version from turbine-2 repo) and 3.0-b3.

This list should help to move your application from Torque 2.1 to 3.0. If you find any other issues, please send an email to the developer list.

new package names

old name new name
org.apache.turbine.torque.* org.apache.torque.*
org.apache.turbine.util.db.adapter.* org.apache.torque.adapter.*
org.apache.turbine.services.db.TurbineDB org.apache.torque.Torque
org.apache.turbine.util.db.map.IDMethod org.apache.torque.adapter.IDMethod
org.apache.turbine.util.db.map.MapBuilder org.apache.torque.map.MapBuilder
org.apache.turbine.util.db.map.ColumnMap org.apache.torque.map.ColumnMap
org.apache.turbine.util.db.map.DatabaseMap org.apache.torque.map.DatabaseMap
org.apache.turbine.util.db.map.TableMap org.apache.torque.map.TableMap
org.apache.turbine.om.Persistent org.apache.torque.om.Persistent
org.apache.turbine.om.Retrievable removed
org.apache.turbine.om.Retriever removed
org.apache.turbine.om.RetrieverFactory removed
org.apache.turbine.om.BaseObject org.apache.torque.om.
org.apache.turbine.om.ComboKey org.apache.torque.om.ComboKey
org.apache.turbine.om.DateKey org.apache.torque.om.DateKey
org.apache.turbine.om.NumberKey org.apache.torque.om.NumberKey
org.apache.turbine.om.ObjectKey org.apache.torque.om.ObjectKey
org.apache.turbine.om.SimpleKey org.apache.torque.om.SimpleKey
org.apache.turbine.om.StringKey org.apache.torque.om.StringKey
org.apache.turbine.om.peer.BasePeer org.apache.torque.util.BasePeer
org.apache.turbine.util.db.IdGenerator org.apache.torque.oid.IdGenerator
org.apache.turbine.util.db.AutoIncrementIdGenerator org.apache.torque.oid.AutoIncrementIdGenerator
org.apache.turbine.util.db.Criteria org.apache.torque.util.Criteria
org.apache.turbine.util.db.IDBroker org.apache.torque.oid.IDBroker
org.apache.turbine.util.db.IDGeneratorFactory org.apache.torque.oid.IDGeneratorFactory
org.apache.turbine.util.db.LargeSelect org.apache.torque.util.LargeSelect
org.apache.turbine.util.db.Query org.apache.torque.util.Query
org.apache.turbine.util.db.SequenceIdGenerator org.apache.torque.oid.SequenceIdGenerator
org.apache.turbine.util.db.SqlExpression org.apache.torque.util.SqlExpression

Changes that could (will) break older environments

  • API changed: Torque uses List instead of Vector.

    e.g. BasePeer.doSelect() returns a List now
  • the pool packages has been removed

    commons-jdbc2pool is used instead.

Other changes

  • new idMethod NATIVE. this replaces SEQUENCE and AUTOINCREMENT
  • support for axion added

Fixed bugs

  • fixed logging when category is null.

Changes

  • 16 Apr 2002
    • Use JCS instead of stratum.JCS and commons.configuration instead of stratum.configuration. (ks)
  • 17 Mar 2002
    • Fix from Bill Schneider (bschneider NOSPAM vecna.com) to correct date handling in the DBOracle database adapter. (dlr)
  • 07 Mar 2002
    • Modified the Oracle db.props to set the VARBINARY type to BLOB because Oracle requires a length limit for RAW. Suggestion by: thierry.lach NOSPAM pentamark.com on the Scarab mailing list.
  • 01 Mar 2002
    • Modified most places that torque was throwing the general exception in favor of TorqueException
  • 21 Feb 2002
    • Handling of object data no longer needs to be wrapped in a transaction when the Postgres bytea type is used instead of the oid hack for the JDBC type VARBINARY.
    • Deprecated DB.objectDataNeedsTrans(). Postgres was the only RDBMS using the objectDataNeedsTrans() method.
    • Removed use of objectDataNeedsTrans() in BasePeer
    • Added load-templates for SAPDB
  • 16 Feb 2002
    • Fix TorqueDataSQLTask (Column names were not generated)
    • Fix Path handling in TorqueSQLExec task
    • Better mapping of binary data types for Postgres
  • 12 Feb 2002
    • made Category static so that Criteria can be serialized
  • 6 Feb 2002
    • Make Torque implement Configurable and Initializeable (stratum)
    • Use the stratum.configuration package instead of ExtendedProperties
  • 28 Jan 2002
    • Using JAXP api. Lost feature of conditional validation.
    • Moved to Xerces2.
  • 20 Jan 2002
    • Made SqlEnum implement Serializable (to facilitate easy HttpSession serialization).
  • 18 Dec 2001
    • add 'description' attribute to <table> and <column>
    • Added TorqueDocumentationTask to generate schema docs in html or xml (anakia)
  • 14 Dec 2001
    • From patch submitted by Byron Foster: Updated DBFactory to know about the other Sybase jdbc driver name.
    • From patch submitted by Byron Foster: Sybase is not fully jdbc 2.0 compliant, so the TorqueDataDumpTask.TableTool needed to be reimplemented using Village. This provided support for any jdbc driver that Village supports ( and Torque since it is currently implemented with Village ). The downside to this implementation is QueryDataSet loads the entire result set into memory, so for large tables this may prove to be trouble.
    • From patch submitted by Byron Foster: Added missing pieces of sybase support to the repository and created a sybase-status document in notes.
  • 13 Dec 2001
    • added flag to shut off heavy indexing on a table by table basis or for the entire schema.
  • 9 Dec 2001
    • Modified Peer classes so that they can be unserialized prior to Torque being initialized. This situation occurs when restarting catalina for example.
    • deprecated getTable and get<columnName> methods in MapBuilder.vm
  • 6 Dec 2001
    • consolidated all Class member initializations methods in generated peers into a single method, and improved the error handling and reporting of that method.
    • add oracle suport for DataSQLTask patch by Dan.Everton@Australia.Boeing.com
    • fixed path problems in TorqueDataSQLTask patch by Dan.Everton@Australia.Boeing.com
  • 16 Nov 2001
    • used db specific templates for data SQL generation
  • 15 Nov 2001
    • fixing SQL generation problem where a table has no primary key
    • removed the use of non-functional double-checked locking in Torque.getDatabaseMap(String).

      made Torque.initDatabaseMap(String) more robust by copying the existing HashMap dbMaps to avoid possible CMEs.
  • 12 Nov 2001
    • Made the driver -> adapter map complete. Thanks to Hugh Brien for spotting the problem.
    • Added support for Cloudscape. Thanks to David Sean Taylor from the Jetspeed group.
  • 11 Nov 2001
    • Cleaned up the initialization sequence too allow a common pattern for stand-alone and embedded usage.
  • 8 Nov 2001
    • Remove get/setCategory(c) in Torque.java and updated all classes that relied on these methods to instantiate their own Category for logging.
    • Merged the init() and init2() methods together. We will still search in the "services.DatabaseService" namespace until Scarab switches over to using the "torque" namespace.
    • Added support to specify the schema used to get data from jdbc (TorqueJDBCTransforTask). Now you can get the data for one schema instead of the whole database. (only effects oracle)

      patch by Dan Bachelder (chowda@chowda.net)
    7 Nov 2001
    • Using log4j correctly now instead of trying to fudge the Category to use for logging. Property log4j configurations are now required and there is no "default" category. All categories are based on the name of the class using the category.
    • Added DOUBLE as a valid type for a column in a datamodel descriptor.
    • Fixed the TorqueDataDTDTask.
    • Fixed the TorqueDataDumpTask.
  • 6 Nov 2001
    • Fixed the IDBroker so that it would work correctly with PostgreSQL.
    • Simplified the DBFactory and the Torque.properties file by eliminating the requirement of the adapter properties. The adapters are stored by JDBC driver name and that is already defined in the torque.database.{db}.driver property.