ReportMill 10 API

com.reportmill.datasource
Class RMJoin

java.lang.Object
  extended by com.reportmill.datasource.RMProperty
      extended by com.reportmill.datasource.RMJoin
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable

public class RMJoin
extends RMProperty

An RMJoin is a subclass of RMProperty that represents an SQL join operation. Can be included in an RMSchema, and ultimately is used in building the SELECT statement. Immutable


Field Summary
 
Fields inherited from class com.reportmill.datasource.RMProperty
TYPE_BINARY, TYPE_BOOLEAN, TYPE_DATE, TYPE_LIST, TYPE_MAP, TYPE_NUMBER, TYPE_OTHER, TYPE_STRING
 
Constructor Summary
RMJoin(RMEntity dest)
          Create a join between the root and a table.
RMJoin(java.lang.String name, RMEntity src, RMProperty srcProp, RMEntity dest, RMProperty destProp, java.lang.String joinOp, boolean toMany)
          Create a join between two tables
 
Method Summary
 RMEntity getDestination()
           
 RMProperty getDestinationProperty()
           
 java.lang.String getDestinationString()
           
 java.lang.String getJoinOperation()
           
 RMEntity getSource()
           
 RMProperty getSourceProperty()
           
 java.lang.String getSourceString()
           
 java.lang.String getSQLForPropertyValue(RMProperty aProp, java.lang.Object aVal)
          convert a value to the sql syntax approprite for the given property type.
 java.lang.String getSQLForSource(java.lang.Object srcKey, java.lang.String dstAlias)
          Construct the sql used when fetching only those destination rows that would join to a particular source row.
 java.lang.String getSQLJoinClause(java.lang.String srcAlias, java.lang.String dstAlias)
          Construct the sql used to when joining the two tables in the RMJoin.
 java.lang.String getSubquery()
           
 void setSubquery(java.lang.String q)
           
 java.lang.String toString()
          Returns a string representation of this property (its name).
 
Methods inherited from class com.reportmill.datasource.RMProperty
clone, compareTo, equals, fromXML, getAlias, getFormat, getMetaData, getName, getNextUniqueId, getSQLType, getSQLType, getSQLTypes, getSQLTypeString, getSQLTypeString, getSubtype, getSubtypeClass, getType, getType, isAttribute, isPrimary, isPrivate, isRelation, isToMany, isValidTypeSQLTypePair, setFormat, setMetaData, setMetaDataValueClass, setName, setPrimary, setPrivate, setSQLType, setSubtype, setSubtypeClass, setType, setTypeFromSample, toXML, valueOf
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RMJoin

public RMJoin(java.lang.String name,
              RMEntity src,
              RMProperty srcProp,
              RMEntity dest,
              RMProperty destProp,
              java.lang.String joinOp,
              boolean toMany)
Create a join between two tables


RMJoin

public RMJoin(RMEntity dest)
Create a join between the root and a table.

Method Detail

getSource

public RMEntity getSource()

getSourceProperty

public RMProperty getSourceProperty()

getDestination

public RMEntity getDestination()

getDestinationProperty

public RMProperty getDestinationProperty()

getJoinOperation

public java.lang.String getJoinOperation()

getSourceString

public java.lang.String getSourceString()

getDestinationString

public java.lang.String getDestinationString()

toString

public java.lang.String toString()
Description copied from class: RMProperty
Returns a string representation of this property (its name).

Overrides:
toString in class RMProperty

getSQLJoinClause

public java.lang.String getSQLJoinClause(java.lang.String srcAlias,
                                         java.lang.String dstAlias)
Construct the sql used to when joining the two tables in the RMJoin. You would use this when fetching everthing in the join all at once. For example. SELECT * FROM SRC, DST where SRC.SRCATTRIBUTE = DST.DSTATTRIBUTE


getSQLForSource

public java.lang.String getSQLForSource(java.lang.Object srcKey,
                                        java.lang.String dstAlias)
Construct the sql used when fetching only those destination rows that would join to a particular source row. For example. SELECT * FROM DST where DST.DSTATTRIBUTE = 3323


getSQLForPropertyValue

public java.lang.String getSQLForPropertyValue(RMProperty aProp,
                                               java.lang.Object aVal)
convert a value to the sql syntax approprite for the given property type.


getSubquery

public java.lang.String getSubquery()

setSubquery

public void setSubquery(java.lang.String q)

ReportMill 10 API