Expresso 5-6

com.jcorporate.expresso.core.dataobjects.jdbc
Class JoinedDigesterBean

java.lang.Object
  extended bycom.jcorporate.expresso.core.dataobjects.jdbc.JoinedDigesterBean

public class JoinedDigesterBean
extends Object

Not yet released - do not use in your own code yet. This class provides the Digester information to parse the join definitions so that we can define the join definition in an XML file.

Author:
Michael Rimov

Nested Class Summary
 class JoinedDigesterBean.DigesterJoinedDataObject
          Bean representing all the dataobject information.
 class JoinedDigesterBean.DigesterJoinRelations
          Bean representing all the joined relation information.
 
Constructor Summary
JoinedDigesterBean()
           
 
Method Summary
 void addDataObject(String className, String definitionName, String alias)
           
 void addDataObject(String className, String definitionName, String alias, String fieldExpressionList)
           
 void addRelation(String localAlias, String localKey, String foreignAlias, String foreignKey, String joinType)
          Adds a relation to the data we've collected from Digester
 org.apache.commons.digester.Digester buildDigester()
          Builds the digester so it is ready to parse rules.
 void digest(org.apache.commons.digester.Digester parser, URL location)
          Mergest the data from the given URL into the current object.
 List getDataObjects()
          Retrieve a list of the dataobjects for this join.
 String getDescription()
           
 Map getPermissions()
          Retrieve the permissions
 List getRelations()
          Retrieves a list of the relations with this bean.
 boolean isDistinct()
          Returns whether the join is distinct or not.
 void loadJoinData(URL location)
          Loads the join data by constructing the Digester object and then merging the given URL into the current data.
 void setDescription(String description)
           
 void setDistinct(boolean distinct)
          Sets whether the join is distinct or not.
 void setDistinct(Boolean newValue)
          Sets whether the join is distinct or not with a Boolean value.
 void setDistinct(String newValue)
          Sets whether the join is distinct or not with a string value.
 void setPermissions(Boolean create, Boolean read, Boolean update, Boolean delete)
          Set the permissions of the join
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JoinedDigesterBean

public JoinedDigesterBean()
Method Detail

addDataObject

public void addDataObject(String className,
                          String definitionName,
                          String alias,
                          String fieldExpressionList)

addDataObject

public void addDataObject(String className,
                          String definitionName,
                          String alias)

addRelation

public void addRelation(String localAlias,
                        String localKey,
                        String foreignAlias,
                        String foreignKey,
                        String joinType)
Adds a relation to the data we've collected from Digester

Parameters:
localAlias - the local 'short name' of the dbobject
localKey - the local 'key' of the dbobject [Pipe delimited for multiple keys]
foreignAlias - the foreign 'short name' of the dbobject
foreignKey - the foreign keys (Pipe Delimited for multiple keys)
joinType - The type of join. Either left|right|inner or blank

loadJoinData

public void loadJoinData(URL location)
Loads the join data by constructing the Digester object and then merging the given URL into the current data.

Parameters:
location - the location to load the data from.

setPermissions

public void setPermissions(Boolean create,
                           Boolean read,
                           Boolean update,
                           Boolean delete)
Set the permissions of the join

Parameters:
create - create permission
read - read permission
update - update permission
delete - delete permission

getPermissions

public Map getPermissions()
Retrieve the permissions

Returns:
java.util.Map

buildDigester

public org.apache.commons.digester.Digester buildDigester()
Builds the digester so it is ready to parse rules.

Returns:
a commons Digester instance with all rules built.

digest

public void digest(org.apache.commons.digester.Digester parser,
                   URL location)
Mergest the data from the given URL into the current object. If the load fails, nothing will be added, and a log will be noted

Parameters:
parser - the constructed Digester object
location - the URL location to load.

getDataObjects

public List getDataObjects()
Retrieve a list of the dataobjects for this join.

Returns:
java.util.List of DigesterJoinedDataObject beans/

isDistinct

public boolean isDistinct()
Returns whether the join is distinct or not.

Returns:
true if the join needs to be distinct.

setDistinct

public void setDistinct(boolean distinct)
Sets whether the join is distinct or not. Should normally only be called by the digester

Parameters:
distinct - new distinct value.

setDistinct

public void setDistinct(Boolean newValue)
Sets whether the join is distinct or not with a Boolean value. Expresso parses the value appropriately

Parameters:
newValue - the new String value

setDistinct

public void setDistinct(String newValue)
Sets whether the join is distinct or not with a string value. Expresso parses the value appropriately

Parameters:
newValue - the new String value

getRelations

public List getRelations()
Retrieves a list of the relations with this bean.

Returns:
java.util.List of DigesterJoinRelations beans

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.