Apache Torque

Apache Torque is a sub project of the Apache Software Foundation Database Project. It is an object-relational mapper for Java. Torque lets you access and manipulate data in a relational database using Java objects. Unlike most other object-relational mappers, Torque does not use reflection to access user-provided classes, but it generates the necessary classes (including the Data Objects) from an XML document and DTD describing the database schema (which can either be written by hand or generated from an existing database). The same XML documents can also be used to generate and execute a SQL script which creates all the tables in the database. These generation steps are performed through the Velocity templating engine.

As Torque hides database-specific implementation details, Torque makes an application independent of a specific database vendor, if no exotic features of the database are used. A single XML document and DTD represents the overall schema, with platform-specific tailoring provided by Velocity templates and platform-specific XML where needed. This platform-specific component may be only around a tenth of the overall source volume, a useful saving when supporting multi-platform products.

Usage of autogeneration eases the customization of the database layer, as you can override the autogenerated methods and thus easily change their behaviour. This allows for both rapid prototyping and easier long term maintenance of an application's database layer.

Torque's use of the XML document and DTD is rather unusual in the XML world, as rather than using a single fixed XML schema (or doctype) for all "Torque schema definitions" and keeping the application schema entirely within the XML document, Torque instead uses the DTD to represent the table / column mappings and the XML document is only used to describe application data. This permits Torque to use XML validation to validate the "data" component against the "schema" component of the target application. However it also means that schema generation, schema auto-documentation and schema authoring must work with the less familiar DTD syntax, rather than XML. In particular, this prevents XSLT being applied to a Torque schema in a useful manner.

Read more about Apache Torque:  History, See Also

Famous quotes containing the words apache and/or torque:

    The Apache have a legend that the coyote brought them fire and that the bear in his hibernations communes with the spirits of the “overworld” and later imparts the wisdom gained thereby to the medicine men.
    —Administration in the State of Arizona, U.S. public relief program (1935-1943)

    Poetry uses the hub of a torque converter for a jello mold.
    Diane Glancy (b. 1941)