com.force.sdk.jpa.table
Class RelationshipImpl

java.lang.Object
  extended by com.force.sdk.jpa.table.ColumnImpl
      extended by com.force.sdk.jpa.table.RelationshipImpl

public class RelationshipImpl
extends ColumnImpl

Representation of a collection of related objects on a Force.com object. If Object A has a lookup field to Object B and B thus has a collection of Object As, the collection is not actually represented as a field in Force.com, but rather the lookup to B implies the collection. Because of this we need to be able to differentiate between these types of columns.

Author:
Jill Wetzler

Field Summary
 
Fields inherited from class com.force.sdk.jpa.table.ColumnImpl
CUSTOM_RELATIONSHIP_SUFFIX, CUSTOM_THING_SUFFIX, fieldName
 
Constructor Summary
RelationshipImpl(String fieldName)
          create a RelationshipImpl with a given field name, such as "Opportunities" on the account object, or "MyCustomObjects__r".
 
Method Summary
 boolean appendSelectString(ExpressionBuilderHelper queryHelper, org.datanucleus.metadata.AbstractClassMetaData acmd, int fieldNum, boolean appendComma, String prefix)
          appends itself to the select statement of a query.
 String getFieldName()
           
 String getSelectFieldName()
           
 com.sforce.soap.partner.FieldType getType()
          Returns the Force.com API field type for this column.
 boolean isCustom()
          method that returns whether the relationship is from a custom lookup field or one that comes standard with Force.com.
 
Methods inherited from class com.force.sdk.jpa.table.ColumnImpl
appendPrefix, getField, getForceApiName, getForceApiRelationshipName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RelationshipImpl

public RelationshipImpl(String fieldName)
create a RelationshipImpl with a given field name, such as "Opportunities" on the account object, or "MyCustomObjects__r".

Parameters:
fieldName - the name of the relationship field
Method Detail

isCustom

public boolean isCustom()
method that returns whether the relationship is from a custom lookup field or one that comes standard with Force.com.

Overrides:
isCustom in class ColumnImpl
Returns:
true if the relationship is custom, false if standard

getFieldName

public String getFieldName()
Overrides:
getFieldName in class ColumnImpl

getType

public com.sforce.soap.partner.FieldType getType()
Description copied from class: ColumnImpl
Returns the Force.com API field type for this column.

Overrides:
getType in class ColumnImpl
Returns:
Force.com API field type

appendSelectString

public boolean appendSelectString(ExpressionBuilderHelper queryHelper,
                                  org.datanucleus.metadata.AbstractClassMetaData acmd,
                                  int fieldNum,
                                  boolean appendComma,
                                  String prefix)
appends itself to the select statement of a query. Append an in progress SOQL select string with the right name for this field.

Overrides:
appendSelectString in class ColumnImpl
Parameters:
queryHelper - the expression builder that is currently in progress
acmd - the class metadata for the entity this field belongs to
fieldNum - the number of this field in DataNucleus
appendComma - whether to append a comma before the field
prefix - the prefix to prepend, if necessary
Returns:
true if something was appended to the query

getSelectFieldName

public String getSelectFieldName()
Overrides:
getSelectFieldName in class ColumnImpl


Copyright © 2011. All Rights Reserved.