com.groiss.reporting.data
Class Entity

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

public class Entity
extends Object

A Entity contains Attributes which are usable in reporting


Constructor Summary
Entity(String id, String name, String c, String table, String alias, Resource res)
          public contstructer
 
Method Summary
 void addAttribute(String key, Attribute a)
          adding a new attribute to the entity
 void addRelation(com.groiss.reporting.data.impl.Relation r)
           
 void addSelection(com.groiss.reporting.data.impl.Condition c)
          adding a selection condition
 boolean containsRelation(com.groiss.reporting.data.impl.Relation r)
           
 String getAlias()
           
 Element getAsDomElement()
           
 Attribute getAttribute(String key)
           
 HashMap<String,Attribute> getAttributes()
          returns all Attributes of this Entity
 String getId()
           
 String getLocalizedName()
           
 String getName()
           
static String getName(String id)
           
 List<com.groiss.reporting.data.impl.Relation> getRelations()
           
 Resource getResource()
           
 List<com.groiss.reporting.data.impl.Condition> getSelections()
           
 String getSelectionString(String prefix)
           
 String getTable()
           
 Class<?> getType()
           
 void setAlias(String alias)
           
 void setName(String name)
           
 void setTable(String table)
           
 void setType(Class<?> type)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Entity

public Entity(String id,
              String name,
              String c,
              String table,
              String alias,
              Resource res)
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 String getId()
Returns:
the id of the entity

getName

public String getName()

getLocalizedName

public String getLocalizedName()
Returns:
the name of the entity

getType

public Class<?> getType()
Returns:
the persistent implementing Class of this Entity

getTable

public String getTable()
Returns:
the tablename

getAttributes

public HashMap<String,Attribute> getAttributes()
returns all Attributes of this Entity

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

addAttribute

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

Parameters:
key - the attribute id
a - the attribute

getResource

public Resource getResource()
Returns:
the resource of this Entity (needed for forms)

getAttribute

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

toString

public String toString()
Overrides:
toString in class Object

addRelation

public void addRelation(com.groiss.reporting.data.impl.Relation r)

getRelations

public List<com.groiss.reporting.data.impl.Relation> getRelations()

containsRelation

public boolean containsRelation(com.groiss.reporting.data.impl.Relation r)

addSelection

public void addSelection(com.groiss.reporting.data.impl.Condition c)
adding a selection condition

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

getSelections

public List<com.groiss.reporting.data.impl.Condition> getSelections()
Returns:
a vector containing all Selections of this entity

getSelectionString

public String getSelectionString(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 String getAlias()

getName

public static String getName(String id)

getAsDomElement

public Element getAsDomElement()

setAlias

public void setAlias(String alias)

setName

public void setName(String name)

setTable

public void setTable(String table)

setType

public void setType(Class<?> type)


@enterprise 8.0.10078 Copyright © 2001-2011 Groiss Informatics GmbH. All Rights Reserved.