org.apache.torque.templates.transformer.om
Class OMForeignKeyTransformer
java.lang.Object
org.apache.torque.templates.transformer.om.OMForeignKeyTransformer
public class OMForeignKeyTransformer
- extends Object
Sets the foreign tables for each of the foreign keys,
and define variables, getters and setters for the complexObjectModel.
So the source elements are (attributes not shown)
foreign-key
reference
reference
...
and the result is
foreign-key
reference
local-column
column
foreign-column
column
reference
local-column
column
foreign-column
column
...
local-field (properties for the field on the local table's database object
referencing the foreign database object)
foreign-field (properties for the field on the foreign table's
database object referencing the local database objects)
table (the foreign referenced table)
On running this transformer, the javaName Attribute on the columns
must be set properly.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OMForeignKeyTransformer
public OMForeignKeyTransformer()
transform
public void transform(SourceElement foreignKey,
ControllerState controllerState)
throws SourceTransformerException
- Throws:
SourceTransformerException
transformSecondPass
public void transformSecondPass(SourceElement foreignKey,
ControllerState controllerState)
throws SourceTransformerException
- Second pass of the transformation. Performs all steps which require that
the first pass is complete.
- Parameters:
foreignKey
- the element to transform, not null.controllerState
- the controller state, not null.
- Throws:
SourceTransformerException
- if the transformation fails
createLocalElementForReference
protected void createLocalElementForReference(SourceElement localTable,
SourceElement reference)
- Creates the child element "local-column" for the reference element
and adds the local column as a child of it.
- Parameters:
localTable
- the local table element.reference
- the refenced element to enrich.
Copyright © 2000-2013 The Apache Software Foundation. All Rights Reserved.