com.groiss.reporting.data
Class Relation

java.lang.Object
  extended by com.groiss.reporting.data.Relation

public class Relation
extends java.lang.Object

Author:
gerald A relation contains 2 Joinparts connected by an operator

Constructor Summary
Relation(JoinPart part1, JoinPart part2, java.lang.String name, java.lang.String id, java.lang.String oj)
          public constructor
 
Method Summary
 boolean containsEntity(java.lang.String e)
           
 boolean equals(java.lang.Object o)
           
 org.jdom.Element getAsDomElement()
           
 java.lang.String getFirstEntity()
           
 java.lang.String getId()
           
 JoinPart[] getJoinParts()
           
 java.lang.String getJoinString(java.lang.String prefix1, java.lang.String prefix2)
          getting the correct sql syntax of the join of this relation
 java.lang.String getName()
           
 JoinPart getOtherJoinPart(Entity e)
           
 JoinPart getOtherJoinPart(java.lang.String e)
           
 java.lang.String getOuterJoin()
           
 java.lang.String getSecondEntity()
           
 JoinPart getThisJoinPart(Entity e)
           
 JoinPart getThisJoinPart(java.lang.String e)
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Relation

public Relation(JoinPart part1,
                JoinPart part2,
                java.lang.String name,
                java.lang.String id,
                java.lang.String oj)
public constructor

Parameters:
part1 - - the first joinpart
part2 - - the second joinpart
name - - the name
Method Detail

getJoinString

public java.lang.String getJoinString(java.lang.String prefix1,
                                      java.lang.String prefix2)
getting the correct sql syntax of the join of this relation

Parameters:
prefix1 - - the alias name of the entity of the first JoinPart
prefix2- - the alias name of the entity of the second JoinPart
Returns:
a correct SQL Join

getFirstEntity

public java.lang.String getFirstEntity()
Returns:
the entity of the first JoinPart

getSecondEntity

public java.lang.String getSecondEntity()
Returns:
the entity of the second JoinPart

getName

public java.lang.String getName()

getId

public java.lang.String getId()

containsEntity

public boolean containsEntity(java.lang.String e)
Parameters:
e - - the entity to check
Returns:
true if relation contains a Joinpart, which contains the given entity; false otherwise

getThisJoinPart

public JoinPart getThisJoinPart(Entity e)
Parameters:
e -
Returns:
the joinpart containing the entity; null if none of the joinparts contains the entity

getThisJoinPart

public JoinPart getThisJoinPart(java.lang.String e)

getOtherJoinPart

public JoinPart getOtherJoinPart(Entity e)
Parameters:
e -
Returns:
the joinpart containing is not the entity, if the other joinpart contains the entity; null if none of the joinparts contains the entity

getOtherJoinPart

public JoinPart getOtherJoinPart(java.lang.String e)

getJoinParts

public JoinPart[] getJoinParts()

getOuterJoin

public java.lang.String getOuterJoin()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getAsDomElement

public org.jdom.Element getAsDomElement()


Copyright © 2001-2006 Groiss Informatics GmbH. All Rights Reserved.