Klasse DatabaseField

java.lang.Object
com.inet.report.Field
com.inet.report.DatabaseField
Alle implementierten Schnittstellen:
NodeParser, com.inet.report.ReferencedObject, Serializable

public class DatabaseField extends Field
This class represents a database field.
A DatabaseField holds the information needed to use a field from a database table.
When a field will be evaluated the data of the field are fetched for each record in the table. Therefore the full name of the field in the database table is needed, i.e. "People.Phonenumber". Set it when adding the field to the table source with the method TableSource.addColumn(String, int) in class TableSource or with method setName(String). The short name is an alias for the full name, i.e. Phonenumber.
Adding and removing of a DatabaseField is handled by class TableSource. You can use the following methods to add a database field to an existing report:
engine.getDatabaseTables().getDataSource(string).getTableSource(int or string).addColumn(String, int).
Getting of a DatabaseField is handled by class Fields. You can use the following method to get a database field of an existing report:
engine.getFields().getDatabaseField(int or string).
To print the fetched data in the report you have to fill it into a FieldElement or FieldPart.

This class is part of the RDC.
Seit:
1.0
Siehe auch:
  • Methodendetails

    • setName

      public void setName(String fullname) throws ReportException
      Specifies the name of the DatabaseField.
      The name have to start with the name of the table separated with a dot, i.e. table.column.
      The short name of this field is set to the name of the column. The value type of the database field will be read from the database.
      Angegeben von:
      setName in Klasse Field
      Parameter:
      fullname - The qualified column name for this database field.
      Löst aus:
      ReportException - If the alias or table name was missing.
      IllegalArgumentException - If the database field name was empty
      Seit:
      1.0
    • setColumnLabel

      public void setColumnLabel(String columnLabel)
      Specifies an alias for table columns. The label is an additional information. It can be used to explain abstract column names. This label will be used from i-net Designer for example. It don't influence the SQL generation.
      Parameter:
      columnLabel - Label of the database field
      Seit:
      6.0
      Siehe auch:
    • getColumnLabel

      public String getColumnLabel()
      Returns the label of this DatabaseField. The label is an additional information only. It can be used to explain abstract column names. This label will be used from i-net Designer for example.
      Gibt zurück:
      Label of the database field as String.
      Seit:
      6.0
      Siehe auch:
    • hasColumnLabel

      public boolean hasColumnLabel()
      Returns whether a column label was set or not.
      Gibt zurück:
      true if a column label was set, false otherwise.
      Seit:
      6.0
      Siehe auch:
    • getShortName

      public String getShortName()
      Returns the short name of a database field.
      This is the name of the database-column without leading table-name, i.e. the name of the database field is 'Customers.Customer ID', the short name should be 'Customer ID'.
      Gibt zurück:
      The short name of the database field as String.
      Seit:
      1.0
    • rename

      public void rename(String newName) throws ReportException
      FOR INTERNAL USE ONLY
      Setzt außer Kraft:
      rename in Klasse Field
      Löst aus:
      ReportException
    • saveFieldXML2

      protected void saveFieldXML2(PrintWriter pw, int depth)
      FOR INTERNAL USE ONLY
      Angegeben von:
      saveFieldXML2 in Klasse Field
      Parameter:
      pw - the print writer
      depth - the current depth
    • getTableSource

      public TableSource getTableSource()
      Returns the table source this database field is based on, will never return null.
      Gibt zurück:
      TableSource this database field is based on, never null
      Seit:
      7.0
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object