DBVIEW
src/org/dbview/db/structure/TableToTableRelation.java
00001 /*
00002         DbView - Graph Visualization
00003     Copyright (C) 2012  Denis BEURIVE
00004 
00005     This program is free software: you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation, either version 3 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 package org.dbview.db.structure;
00020 import java.util.ArrayList;
00021 
00022 /**
00023  * <p>This class represents a relation between two tables.</p>
00024  * <ul>
00025  *      <li>A "table to table" relation contains one or more joins.</li>
00026  *      <li>It also contains extra information.</li>
00027  * </ul>
00028  * <p>Graphically, a relation (between two tables) is represented by an arrow.</p>
00029  * <ul>
00030  *      <li>The start of the arrow is the "dependent" table (that defines the foreign keys).</li>
00031  *      <li>The arrow points to the "reference" table.</li>
00032  *      <li>A relation contains at least one join (between two fields).</li>
00033  * </ul>
00034  * @author Denis Beurive
00035  */
00036 class TableToTableRelation
00037 {
00038     public TableToTableRelation() { this.relations = new ArrayList<FieldToFieldJoin>(); }
00039 
00040     /**
00041      * List of joins.
00042      */
00043     public ArrayList<FieldToFieldJoin> relations = null;
00044 
00045     /**
00046      * The type of "table to table" relation. It can be:
00047      * <ul>
00048      *    <li>SOFT_AND_HARD_LINK</li>
00049      *    <li>SOFT_LINK</li>
00050      *    <li>HARD_LINK</li>
00051      * </ul>
00052      */
00053     public int type = Database.UNDEFINED_LINK;
00054 }