org.caleigo.core
Class CompositeEntityDescriptor.CompositeFieldGroup

java.lang.Object
  extended byorg.caleigo.core.CompositeEntityDescriptor.CompositeFieldGroup
All Implemented Interfaces:
ICompositeEntityDescriptor.ICompositeFieldGroup
Enclosing class:
CompositeEntityDescriptor

public static final class CompositeEntityDescriptor.CompositeFieldGroup
extends java.lang.Object
implements ICompositeEntityDescriptor.ICompositeFieldGroup

The ICompositeFieldGroup is used to group sets of fields belonging to a single entity-descriptor (of the class ICompositeEntityDescriptor) together and to define their relation with each other. Note that several field groups may have the same base entity descriptor but represent different records in the data space.


Nested Class Summary
protected  class CompositeEntityDescriptor.CompositeFieldGroup.CompositeFieldDescriptor
          The ICompositeFieldDescriptor wraps another field descriptor and in many ways acts as a proxy for it.
 
Method Summary
 IBaseEntityDescriptor getBaseEntityDescriptor()
          Returns the entity descriptor of the field group.
 ICompositeEntityDescriptor.ICompositeFieldGroup getChildFieldGroup(int index)
          Returns a specific field group from the the called field group by its ordial index.
 int getChildFieldGroupCount()
          Returns the number of field groups that the called field group contains.
 java.lang.String getEntityIdentity()
          Returns the named identity of the called field groups entity descriptor.
 int getFieldCount()
          Returns the number of field descriptors that the called field group contains.
 ICompositeEntityDescriptor.ICompositeFieldDescriptor getFieldDescriptor(int index)
          Returns a specific field descriptor from the the called field group by its ordial index.
 java.util.Iterator getFieldGroups()
           
 IEntityRelationPath getParentRelationPath()
          Returns the relation path from the parent field group to this field group.
 boolean getRequired()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getBaseEntityDescriptor

public IBaseEntityDescriptor getBaseEntityDescriptor()
Returns the entity descriptor of the field group. All fields must belong to that entity descriptor. A composite entity may however have several fieldgroups with the same entity descriptor, but all must have unique entity identity strings.

Specified by:
getBaseEntityDescriptor in interface ICompositeEntityDescriptor.ICompositeFieldGroup
Returns:
the entity descriptor of the field group. All fields must belong to that entity descriptor. A composite entity may however have several fieldgroups with the same entity descriptor, but all must have unique entity identity strings.

getEntityIdentity

public java.lang.String getEntityIdentity()
Returns the named identity of the called field groups entity descriptor. This will normally be the code name of the entity descriptor unless multiple instances of the descriptor exists.

Specified by:
getEntityIdentity in interface ICompositeEntityDescriptor.ICompositeFieldGroup
Returns:
the named identity of the called field groups entity descriptor. This will normally be the code name of the entity descriptor unless multiple instances of the descriptor exists. It is used as alias in sql-select-questions.

getParentRelationPath

public IEntityRelationPath getParentRelationPath()
Returns the relation path from the parent field group to this field group.

Specified by:
getParentRelationPath in interface ICompositeEntityDescriptor.ICompositeFieldGroup
Returns:
the relation path that goes from the parent field group to this child field group.

getFieldCount

public int getFieldCount()
Returns the number of field descriptors that the called field group contains. This includes both data and calculated field descriptors.

Specified by:
getFieldCount in interface ICompositeEntityDescriptor.ICompositeFieldGroup
Returns:
the number of field descriptors that the called field group contains. This includes both data and calculated field descriptors.

getFieldDescriptor

public ICompositeEntityDescriptor.ICompositeFieldDescriptor getFieldDescriptor(int index)
Returns a specific field descriptor from the the called field group by its ordial index. May cast OutOfBoundException.

Specified by:
getFieldDescriptor in interface ICompositeEntityDescriptor.ICompositeFieldGroup
Returns:
a specific field descriptor from the the called field group by its ordial index. May cast OutOfBoundException.

getChildFieldGroupCount

public int getChildFieldGroupCount()
Returns the number of field groups that the called field group contains. This includes both data and calculated field descriptors.

Specified by:
getChildFieldGroupCount in interface ICompositeEntityDescriptor.ICompositeFieldGroup
Returns:
the number of field groups that the called field group contains. This includes both data and calculated field descriptors.

getChildFieldGroup

public ICompositeEntityDescriptor.ICompositeFieldGroup getChildFieldGroup(int index)
Returns a specific field group from the the called field group by its ordial index. May cast OutOfBoundException.

Specified by:
getChildFieldGroup in interface ICompositeEntityDescriptor.ICompositeFieldGroup
Returns:
a specific field group from the the called field group by its ordial index. May cast OutOfBoundException.

getRequired

public boolean getRequired()
Specified by:
getRequired in interface ICompositeEntityDescriptor.ICompositeFieldGroup
Returns:
a boolean that determine if this field group's fields should be required in joins or not (joins according to SQL92).
true: Inner join.
false: Outer join, null-value might be displayed.

If two groups are related in a parent-child relation the parent is seen as the LEFT and the children as the RIGHT (table). A parent and a child can thus have one of the following four combination resulting in a belonging SQL join-clause:
parent.getRequired()==true & child.getRequired()==true -> inner join
parent.getRequired()==true & child.getRequired()==false -> right outer join
parent.getRequired()==false & child.getRequired()==true -> left outer join
parent.getRequired()==false & child.getRequired()==false -> full outer join

OBS:
Field Group siblings relation doesn't affect the join-clause. The default value should be false resulting in full outer joins between field groups and it's children.

getFieldGroups

public java.util.Iterator getFieldGroups()
Specified by:
getFieldGroups in interface ICompositeEntityDescriptor.ICompositeFieldGroup
Returns:
an iterator that iterates over all field group's that has this field group as root.

toString

public java.lang.String toString()


Copyright © 2005 Caleigo. All Rights Reserved.