com.groiss.reporting.data
Class Entity

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

public class Entity
extends java.lang.Object

A Entity contains Attributes which are usable in reporting


Constructor Summary
Entity(java.lang.String id, java.lang.String name, java.lang.String c, java.lang.String table, java.lang.String alias, Resource res)
          public constructor
 
Method Summary
 void addAttribute(java.lang.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)
           
 java.lang.String getAlias()
           
 org.jdom.Element getAsDomElement()
           
 Attribute getAttribute(java.lang.String key)
           
 java.util.HashMap<java.lang.String,Attribute> getAttributes()
          returns all Attributes of this Entity
 java.lang.String getId()
           
 java.lang.String getLocalizedName()
           
 java.lang.String getName()
           
static java.lang.String getName(java.lang.String id)
           
 java.util.List<com.groiss.reporting.data.impl.Relation> getRelations()
           
 Resource getResource()
           
 java.util.List<com.groiss.reporting.data.impl.Condition> getSelections()
           
 java.lang.String getSelectionString(java.lang.String prefix)
           
 java.lang.String getTable()
           
 java.lang.Class<?> getType()
           
 void setAlias(java.lang.String alias)
           
 void setName(java.lang.String name)
           
 void setTable(java.lang.String table)
           
 void setType(java.lang.Class<?> type)
           
 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,
              Resource res)
public constructor

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

getId

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

getName

public java.lang.String getName()

getLocalizedName

public java.lang.String getLocalizedName()
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<java.lang.String,Attribute> 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

getResource

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

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(com.groiss.reporting.data.impl.Relation r)

getRelations

public java.util.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 java.util.List<com.groiss.reporting.data.impl.Condition> 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()

setAlias

public void setAlias(java.lang.String alias)

setName

public void setName(java.lang.String name)

setTable

public void setTable(java.lang.String table)

setType

public void setType(java.lang.Class<?> type)


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.