Klasse OMForeignKeyTransformer
java.lang.Object
org.apache.torque.templates.transformer.om.OMForeignKeyTransformer
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.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected 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.void
transform
(SourceElement foreignKey, ControllerState controllerState) void
transformSecondPass
(SourceElement foreignKey, ControllerState controllerState) Second pass of the transformation.
-
Konstruktordetails
-
OMForeignKeyTransformer
public OMForeignKeyTransformer()
-
-
Methodendetails
-
transform
public void transform(SourceElement foreignKey, ControllerState controllerState) throws SourceTransformerException - Löst aus:
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.- Parameter:
foreignKey
- the element to transform, not null.controllerState
- the controller state, not null.- Löst aus:
SourceTransformerException
- if the transformation fails
-
createLocalElementForReference
protected void createLocalElementForReference(SourceElement localTable, SourceElement reference) throws SourceTransformerException Creates the child element "local-column" for the reference element and adds the local column as a child of it.- Parameter:
localTable
- the local table element.reference
- the referenced element to enrich.- Löst aus:
SourceTransformerException
- if the referenced column cannot be found.
-