|
Dresden OCL Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttudresden.ocl.codegen.decl.ObjectView
An ObjectView is a View on relational tables of a database containing all columns that are part of the relational mapping of a class that has been mapped to the database during an object-relational mapping very complex attributes as attributes containing muliple values or class references are excluded from the view
Nested Class Summary | |
private class |
ObjectView.Column
|
private class |
ObjectView.Connection
|
Field Summary | |
private String |
className
|
private Vector |
columns
|
private Vector |
connections
|
private String |
viewName
|
Constructor Summary | |
ObjectView(String viewName,
String className)
creates a new ObjectView named viewName for a classifier named className |
Method Summary | |
void |
addColumn(String attribute,
String columnName,
Table table)
adds a Column to the view |
void |
addConnection(String column1,
Table table1,
String column2,
Table table2)
adds a restriction to the 'where'-clause of the view, the restriction is formed like: table1Name.column1 = table2Name.column2 this is used to realize foreign key references |
ObjectView |
copy()
a cind of cloneof the current ObjectView containing the same columns and connections |
Object[][] |
getAttributeColumns(String attribute)
returns all columns the class attribute given was mapped to, null if the attribute isn't contained in the view Object[x][0] = String column name (as used in addColumn()) Object[x][1] = Table original table of colum |
String |
getClassifier()
|
private ObjectView.Column |
getColumn(String name,
Table table)
|
Object[][] |
getColumns()
returns all Information about all defined columns the field is formed like: Object[x][0] = String classAttribute Object[x][1] = String columnName (in the original Table) Object[x][2] = Table originalTable of the Column |
Object[][] |
getConnections()
returns all foreign key connections for the where clause of this view contents of Object[][]: Object[x][0] = String column1 name Object[x][1] = Table table of column1 Object[x][2] = String column2 name Object[x][3] = Table table of column2 the connection should be: table1name.column1 = table2name.column2 |
String |
getName()
|
String |
getPrimaryKeyRepresentation()
returns a representation of this views 'primary key' meaning row identifying columns the String is formed '(pk1, pk2,..)' |
void |
removeColumn(String name,
Table table)
removes a certain column from View |
void |
removeColumnsFor(String attribute)
removes all columns from view that are part of mapping of the given class attribute. |
void |
removePrimaryKey()
resets the primary key flag of all column to false |
protected void |
setColumns(Vector columns)
sets the columns of this view |
protected void |
setConnections(Vector connections)
sets the connections of this View |
void |
setPrimaryKey(String column,
Table table)
defines a column of the view as being part of the 'primary key' of the view, meaning the 'primary key' will be referred for example by Guides to associationends of Associations between classifiers |
void |
setViewNames(String viewName,
String className)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private String viewName
private String className
private Vector columns
private Vector connections
Constructor Detail |
public ObjectView(String viewName, String className)
Method Detail |
public void addColumn(String attribute, String columnName, Table table) throws IllegalArgumentException
attribute
- the name of the class attribute the new column
is representing (partly) in the viewcolumnName
- the name of the column (in its original table)table
- the original table the column is viewed from
IllegalArgumentException
public void addConnection(String column1, Table table1, String column2, Table table2) throws IllegalArgumentException
IllegalArgumentException
public void setPrimaryKey(String column, Table table)
Guide
public Object[][] getColumns()
Table
public void removeColumnsFor(String attribute)
public void removeColumn(String name, Table table)
name
- the name of the Column as used in addColumn()table
- the original Table of the column as used in addColumn()public Object[][] getAttributeColumns(String attribute)
public void removePrimaryKey()
public void setViewNames(String viewName, String className)
viewName
- the name of the ObjectViewclassName
- the name of the classifier the ObjectView representspublic String getName()
public String getClassifier()
public Object[][] getConnections()
Table
public String getPrimaryKeyRepresentation()
protected void setColumns(Vector columns)
columns
- a Vector of Columnprotected void setConnections(Vector connections)
connections
- a Vector of Connectionpublic ObjectView copy()
private ObjectView.Column getColumn(String name, Table table)
|
Dresden OCL Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |