de.mguennewig.pobjects.metadata
Class MapType

java.lang.Object
  extended by de.mguennewig.pobjects.metadata.JoinType
      extended by de.mguennewig.pobjects.metadata.MapType
All Implemented Interfaces:
ReferenceToClass

public class MapType
extends JoinType

Rows of the target table represent a map of values associated with the parent table.

Author:
Michael Günnewig

Field Summary
 
Fields inherited from class de.mguennewig.pobjects.metadata.JoinType
CLASS_NAME, TYPE_NAME
 
Constructor Summary
MapType(java.lang.String targetModule, java.lang.String targetName, ClassDecl targetClass)
          Initialize map data.
 
Method Summary
 java.lang.String name(int variant)
          Returns different names depending on variant for the code generator.
 void setTargetClass(ClassDecl targetClass)
          Sets the class declaration of the referenced table.
 
Methods inherited from class de.mguennewig.pobjects.metadata.JoinType
getTargetClass, getTargetModule, getTargetName, setTypeClass
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapType

public MapType(java.lang.String targetModule,
               java.lang.String targetName,
               ClassDecl targetClass)
Initialize map data.

Parameters:
targetModule - Module of the target class.
targetName - The name of the class the join refers to.
targetClass - The class declaration of the referenced table. This must be given or null with a later call to setTargetClass(ClassDecl) before any usage of this type.
See Also:
setTargetClass(ClassDecl)
Method Detail

setTargetClass

public void setTargetClass(ClassDecl targetClass)
Sets the class declaration of the referenced table.

A call to this method is only necessary if the class declaration has not been passed to the constructor to solve circle problems.

The referenced table must fulfill a couple of requirements depending on join type. The following requirements are common for all:

In addition to the generic restrictions a map type adds the following constraint:

Specified by:
setTargetClass in interface ReferenceToClass
Overrides:
setTargetClass in class JoinType

name

public java.lang.String name(int variant)
Returns different names depending on variant for the code generator.

Overrides:
name in class JoinType