com.agfa.hap.sdo
Class SelectClause

java.lang.Object
  extended by com.agfa.hap.sdo.SelectClause
All Implemented Interfaces:
SnapshotDefinition

public class SelectClause
extends java.lang.Object
implements SnapshotDefinition

SnapshotDefinition defined by a comma-separated list of property paths. Datatype properties (e.g. strings, dates etc) are included by default and should not be part of the select clause. Many-valued properties that are not part of the select string will be unavailable. Single-valued properties that are not part of the select string will be available as proxies when they have their Identity property filled in. Otherwise, they will not be part of the snapshot.

Using '*' as the name of a property indicates all properties of that type. Using '**' indicates all properties recursively. This means all child properties including all properties of those child properties (in case they are not datatypes) recursively. This is similar to ReachableDefinition.

Ex. address, serviceRequests, medicalCase.* for the Patient type will return all basic properties of Patient, its address, its serviceRequests. And also its complete medicalCase including many-valued properties and all its direct links.

Properties that are part of the definition but are not available when creating the snapshot will be accessed. That may result in PropertyNotAvailableException being thrown or might result in lazy retrieval of data (e.g. when working with Hibernate proxies).

Author:
AMOCZ

Constructor Summary
protected SelectClause(PropertyTree propertyTree)
           
  SelectClause(Type mainType)
           
  SelectClause(Type mainType, java.lang.String clause)
           
 
Method Summary
 java.lang.String asCommaSeparatedString()
           
 boolean equals(java.lang.Object other)
           
 PropertyTree getPropertyTree()
           
 int hashCode()
           
<T> void
visit(DataMapper<T> mapper, ObjectPropertyVisitor visitor, T dataObject)
          Visits all properties of the object that are part of the definition.
protected
<T> void
visitChild(DataMapper<T> mapper, ObjectPropertyVisitor visitor, T parent, Property property, PropertyTree propertyTree)
           
protected
<T> void
visitChildObject(DataMapper<T> mapper, ObjectPropertyVisitor visitor, T dataObject, Property property, PropertyTree tree)
           
protected
<T> void
visitProxy(DataMapper<T> mapper, ObjectPropertyVisitor visitor, T dataObject, Property property)
          this method is called if the property is not in the select clause when used with the default SnapshotSerializer : returning directly will result in property with value = null, calling visitProxyProperty with a null identity will result in a not available property calling visitProxyProperty with a non null identity will result in a property with isProxy=true
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectClause

protected SelectClause(PropertyTree propertyTree)

SelectClause

public SelectClause(Type mainType)

SelectClause

public SelectClause(Type mainType,
                    java.lang.String clause)
Method Detail

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

visit

public <T> void visit(DataMapper<T> mapper,
                      ObjectPropertyVisitor visitor,
                      T dataObject)
           throws java.lang.Exception
Description copied from interface: SnapshotDefinition
Visits all properties of the object that are part of the definition.

Specified by:
visit in interface SnapshotDefinition
Throws:
java.lang.Exception

visitProxy

protected <T> void visitProxy(DataMapper<T> mapper,
                              ObjectPropertyVisitor visitor,
                              T dataObject,
                              Property property)
                   throws java.lang.Exception
this method is called if the property is not in the select clause when used with the default SnapshotSerializer : returning directly will result in property with value = null, calling visitProxyProperty with a null identity will result in a not available property calling visitProxyProperty with a non null identity will result in a property with isProxy=true

Type Parameters:
T -
Parameters:
mapper -
visitor -
dataObject -
property -
Throws:
java.lang.Exception

visitChildObject

protected <T> void visitChildObject(DataMapper<T> mapper,
                                    ObjectPropertyVisitor visitor,
                                    T dataObject,
                                    Property property,
                                    PropertyTree tree)
                         throws java.lang.Exception
Throws:
java.lang.Exception

visitChild

protected <T> void visitChild(DataMapper<T> mapper,
                              ObjectPropertyVisitor visitor,
                              T parent,
                              Property property,
                              PropertyTree propertyTree)
                   throws java.lang.Exception
Throws:
java.lang.Exception

getPropertyTree

public PropertyTree getPropertyTree()

asCommaSeparatedString

public java.lang.String asCommaSeparatedString()


Copyright © 2007. All Rights Reserved.