The module generates .per files based on the information from diagrams. Presently, the "current" diagram option is only supported. Open a diagram, start Persistence PowerTier Integration module, check output directory and press ok.
The diagram maps to the PowerTier project file. All classes of the diagram with non-empty DistributionOption property defined become the members of the PowerTier project.
All properties are defined via javadoc style tags. All tags in use are defined in the source file PersistenceTags.java.
There's no need to remember the tags because they are listed in the PowerTier tab of the object inspector.
The class view diagrams only are used to generate *.per files for the PowerTier. We strongly discourage you to use the default diagram for designing a project. The default name for a *.per file is based on the diagram name, and "default" is not a really good name. It is also more convenient to use different diagrams for different files.
The module operates on the entire diagram or on the selected diagram elements. It is impossible to process all selected elements simultaneously if they are on different diagrams. Consider the class diagrams as the source of *.per files.
Class View Diagram properties are used to define PersistenceProperties block of a PowerTier project.
Classes are the basic entities. Any class that has DistributionOption property defined is considered a PowerTier PersistenceClass. Other PowerTier properties of a class can be defined in the inspector pane, too.
All attributes defined in a persistent class are exported. The primitive types are converted according to the type conversion table, see configurable options section.
Attributes can form a primary key. An attribute having primaryKey (Primary Key checkbox in PowerTier tab of the inspector) becomes the primary key. If several attributes have this property, they form a composite primary key, the order of its members follows the order of attributes in class.
Two types of links are used in the Persistence PowerTier Integration module. One is generalization link, which is directly translated into inheritance. The other one is association link. Association links are used to specify relationships and foreign keys.
Specifying foreign keys. An association link from one class to another, with Persistence Role defined as ForeignKey (see inspector), results in the generation of a foreign key. The destination (client) side class' primary key defines the names of attributes included in this foreign key. If this foreign key is the part of primary key, such link should have property identifying. It is recommended to leave FK links directed.
Specifying relationships. A relationship is defined as an undirected association link between two classes. A relationship record consists of two relation arcs. Relation arcs, cardinalities and delete actions for both arcs are specified in the inspector tab. By default, relation arc names are generated from class names if otherwise not specified.
In this section we'll create a simple diagram and
generate a .per file from it. First of all we need to activate PowerTier support module. Once the module is activated, the appropriate configuration file is loaded, PowerTier configuration options tab and PowerTier object inspector tab set up. The module needs to be activated only once, you do not need to do it every time you start Together. To activate PowerTier specific settings, run the module Earlyaccess | Persistence PowerTier Integration | Activate PowerTier Support.
Earlyaccess | Persistence PowerTier Integration | Persistence PowerTier Integration. Select Run
. Now the output directory would be set by default to Together's installation folder <tj>/out/per/<your project name>. Select "current diagram" on the module dialog. Check the Options... dialog. Then press OK. The resulting file can now be found in the Together Installation Folder/out/per/<your_project>/Demo.per. You may check the result with your preferred text editor. The module is distributed as open source. You're welcome to donate your own submissions. Send all suggestions, fixes and modifications to Alexander Aptus
|
PowerTier data type |
Java type |
Comment |
|
|
character string |
|
|
binary string |
|
|
short integer |
|
|
integer |
|
|
long integer |
|
|
floating point |
|
|
longer floating point |
|
|
large text object |
|
|
large binary object |
|
|
money type |
|
|
date type |
|
|
PowerTier key type |
|
|
composite data type |
Since many PowerTier data types have no matching primitive types in Java, it is recommended to explicitly specify PowertierType property for every attribute. You can alter conversion table in Options Editor by specifying which Java type matches every PowerTier type.
All diagram properties are necessary to fill out the PersistenceOptions block of a generated .per file. All descriptions here refer only to PowerTier and not to the integration plugin.
|
Object Inspector Field |
Property Type |
Description |
|
DomainName |
string |
specifies domain name. |
|
DomainFileName |
string |
specifies an element for the names of files generated at the domain level |
|
DomainOutputDir |
string |
specifies the directory where the code generator places generated files for this application |
|
HeaderSuffix |
string |
ignored for PowerTier for Enterprise JavaBeans |
|
SourceSuffix |
string |
ignored for PowerTier for Enterprise JavaBeans |
|
RootFileName |
string |
specifies an element for the names of files generated at the project level. |
|
ProjectInSubdir |
boolean |
indicates whether this project is generated into a directory below the domain output directory. |
|
Package |
string |
when you choose EJBMapping for ProjGenerationOptions, specifies the fully-qualified Java package name for the project. |
|
ProjRWClassIDBase |
decimal or hexadecimal |
|
|
ProjGenerationOptions |
List |
specifies what kind of application to be generated. |
|
Object Inspector Field |
Tag Name |
Type |
Description |
|
TableName |
|
string |
specifies the name of database table or view that maps to this class. |
|
ExistingTable |
|
boolean |
if present, indicates that the table already exists in the database. This keyword must be present if ReadOnly property is also present. |
|
ReadOnly |
|
boolean |
if present, indicates that the application does not modify the database table or view. |
|
FileNameRoot |
|
string |
specifies a root element for the names of generated files for this class. |
|
DistributionOption |
|
List |
specifies what parts of the class are available to the client tier. |
|
Object Inspector Field |
Tag Name |
Type |
Description |
|
PrimaryKey |
|
boolean |
if set, the attribute is primary key, or a member of composite primary key. |
|
PowerTierType |
|
List |
specifies PowerTier data type, it is recommended to specify this property regardless of mapping to avoid obscurity. |
|
ColumnName |
|
string |
specifies column name associated with this attribute |
|
ColumnNames |
|
string |
specifies column names associated with this attribute; use comma separated list here |
|
Queries |
|
string |
specifies the query methods you would like to be generated for this attribute |
|
DomainMin |
|
string |
specifies the minimum value allowed for this attribute |
|
DomainMax |
|
string |
specifies the maximum value allowed for this attribute |
|
OptimisticControl |
|
boolean |
you can specify one attribute in each class to be an optimistic control attribute |
|
DefaultValue |
|
string |
specifies default value for this attribute |
|
Hooks |
|
List |
ignored for PowerTier for Enterprise JavaBeans |
There are two kinds of links that play role in Persistence PowerTier Integration module, association links and generalization links. Generalization links on diagram will produce inheritance in output files. There are no PowerTier-specific properties for that kind of links.
Association links are used to define Relationship and ForeignKey records. The role of an associatin link is defined by its PersistenceRole property. Whether PersistenceRole is set to ForeignKey or Relationship, different properties will be used.
|
Object Inspector Field |
Tag Name |
Type |
Description |
|
PersistenceRole |
|
|
Link role selector. Depending on its value, the properties marked with ForeignKey or Relationship prefixes in description will take effect. |
|
Identifying |
|
boolean |
ForeignKey: specifies whether this FK should also be a part of the primary key. |
|
Client relation arc |
|
string |
Relationship: the name of client relation arc, typically named after destination class |
|
Client cardinality |
|
List |
Relationship: client to supplier relationship cardinality |
|
Supplier relation arc |
|
string |
Relationship: the name of supplier relation arc, typically named after source class |
|
Supplier cardinality |
|
List |
Relationship: supplier to client relationship cardinality |
|
DeleteActionSrc |
|
List |
Relationship: source side delete action |
|
DeleteActionDst |
|
List |
Relationship: destination side delete action |