com.groiss.reporting.data
Class Entity

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

public class Entity
extends java.lang.Object

Author:
gerald A Entity contains Attributes and Selections Attributes are selectable Attributes of this Entity Selections are Conditions selecting the wished set of records

Constructor Summary
Entity(java.lang.String id, java.lang.String name, java.lang.String c, java.lang.String table, java.lang.String alias)
          public contstructer
 
Method Summary
 void addAttribute(java.lang.String key, Attribute a)
          adding a new attribute to the entity
 void addRelation(Relation r)
           
 void addSelection(Condition c)
          adding a selection condition
 boolean containsRelation(Relation r)
           
 java.lang.String getAlias()
           
 org.jdom.Element getAsDomElement()
           
 Attribute getAttribute(java.lang.String key)
           
 java.util.HashMap getAttributes()
          returns all Attributes of this Entity
 java.lang.String getId()
           
 java.lang.String getName()
           
static java.lang.String getName(java.lang.String id)
           
 java.util.Vector getRelations()
           
 java.util.Vector getSelections()
           
 java.lang.String getSelectionString(java.lang.String prefix)
           
 java.lang.String getTable()
           
 java.lang.Class getType()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Entity

public Entity(java.lang.String id,
              java.lang.String name,
              java.lang.String c,
              java.lang.String table,
              java.lang.String alias)
public contstructer

Parameters:
id - - the id of the entity
name - - the name of the entity
c - - The name of the Persisent implementation of this entity
table - - the database tablename
alias - - the default tablealias
Method Detail

getId

public java.lang.String getId()
Returns:
the id of the entity

getName

public java.lang.String getName()
Returns:
the name of the entity

getType

public java.lang.Class getType()
Returns:
the persistent implementing Class of this Entity

getTable

public java.lang.String getTable()
Returns:
the tablename

getAttributes

public java.util.HashMap getAttributes()
returns all Attributes of this Entity

Returns:
A HashMap containing all Attributes keyed by the attributes' id

addAttribute

public void addAttribute(java.lang.String key,
                         Attribute a)
adding a new attribute to the entity

Parameters:
key - the attribute id
a - the attribute

getAttribute

public Attribute getAttribute(java.lang.String key)
Parameters:
key - - the attribute id
Returns:
- the attribute

toString

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

addRelation

public void addRelation(Relation r)

getRelations

public java.util.Vector getRelations()

containsRelation

public boolean containsRelation(Relation r)

addSelection

public void addSelection(Condition c)
adding a selection condition

Parameters:
c - - the condition, which expressions the selection

getSelections

public java.util.Vector getSelections()
Returns:
a vector containing all Selections of this entity

getSelectionString

public java.lang.String getSelectionString(java.lang.String prefix)
Parameters:
prefix - - the table alias get a correct sql syntax
Returns:
a String, containing all selection conditions attached by an AND

getAlias

public java.lang.String getAlias()

getName

public static java.lang.String getName(java.lang.String id)

getAsDomElement

public org.jdom.Element getAsDomElement()


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