|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.force.sdk.jpa.table.TableImpl
public class TableImpl
Represents an object (custom or standard) in Force.com.
Constructor Summary | |
---|---|
TableImpl(String defaultNamespace,
TableName tableName,
com.sforce.soap.partner.DescribeSObjectResult result,
ForceManagedConnection mconn)
Create a TableImpl for an entity. |
|
TableImpl(TableName tableName,
org.datanucleus.metadata.AbstractClassMetaData acmd)
Constructor used for virtual schema (aka tables that aren't actually backed by an object, like Owner). |
Method Summary | |
---|---|
void |
createFields(org.datanucleus.metadata.AbstractClassMetaData cmd,
ForceStoreManager storeManager)
Create custom fields only. |
void |
createTableAndFields(org.datanucleus.metadata.AbstractClassMetaData cmd,
ForceStoreManager storeManager,
ForceManagedConnection mconn)
Create the custom objects and fields for schema creation. |
boolean |
exists()
Check existence of a table in the organization used by the application. |
ColumnImpl |
getColumnAt(org.datanucleus.metadata.AbstractClassMetaData acmd,
int fieldNumber)
Retrieve a Force.com column from the given JPA class metadata at the given field position. |
ColumnImpl |
getColumnAt(int columnIndex)
Retrieves a Force.com column at the given index. |
ColumnImpl |
getColumnByForceApiName(String columnName)
Retrieves a Force.com column with a fully qualified Force.com API name. |
ColumnImpl |
getColumnByJavaName(String columnName)
Retrieves a Force.com column with a Java field name. |
ColumnImpl |
getColumnFor(org.datanucleus.metadata.AbstractClassMetaData acmd,
org.datanucleus.metadata.AbstractMemberMetaData ammd)
Retrieve a Force.com column with the given JPA field metadata. |
List<ColumnImpl> |
getColumnsFor(org.datanucleus.metadata.AbstractClassMetaData acmd,
org.datanucleus.metadata.AbstractMemberMetaData ammd,
ForceStoreManager storeManager,
List<ColumnImpl> columns)
Retrieve a list of Force.com columns with the given JPA field metadata. |
ColumnImpl |
getExternalIdColumn()
|
List<ColumnImpl> |
getListOfColumns()
|
ForceTableMetaData |
getMetaData(org.datanucleus.metadata.AbstractClassMetaData cmd)
Retrieves Force.com table metadata for the given JPA class metadata. |
String |
getPKFieldName(org.datanucleus.metadata.AbstractClassMetaData acmd)
Retrieves the primary key Force.com API field name for the given class metadata. |
boolean |
getTableAlreadyExistsInOrg()
|
TableName |
getTableName()
|
boolean |
isValid()
Entities are considered valid if they exist in the Force.com database. |
void |
refresh(com.sforce.soap.partner.DescribeSObjectResult result,
ForceManagedConnection mconn)
refresh the describe result to verify that objects have been created as we expected. |
void |
registerJavaColumn(String javaFieldName,
ColumnImpl column)
Register a column impl (with specific Force.com attributes, like the API name) under its field or property name in java. |
void |
setIsValid(boolean isValid)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TableImpl(String defaultNamespace, TableName tableName, com.sforce.soap.partner.DescribeSObjectResult result, ForceManagedConnection mconn)
defaultNamespace
- the namespace of the organization connecting to Force.com, to be used by defaulttableName
- the table name of the entityresult
- the result of an API describemconn
- the managed connection to the Force.com APIspublic TableImpl(TableName tableName, org.datanucleus.metadata.AbstractClassMetaData acmd)
tableName
- the table name of the entityacmd
- the class metadataMethod Detail |
---|
public boolean isValid()
exists()
instead if you want to find out if the table exists in the org
public void setIsValid(boolean isValid)
public boolean exists()
public ColumnImpl getExternalIdColumn()
public ColumnImpl getColumnByForceApiName(String columnName)
columnName
- a fully qualified Force.com API name
TableImpl
or null
if no column with the given name existspublic ColumnImpl getColumnByJavaName(String columnName)
Make sure if you're calling this that it happens after schema creation, because this will not be populated until all the class metadata has been fully initialized.
columnName
- a Java field name
TableImpl
or null
if no column with the given name existspublic void registerJavaColumn(String javaFieldName, ColumnImpl column)
javaFieldName
- the name of a field or property in javacolumn
- the column object corresponding to this fieldpublic ColumnImpl getColumnAt(int columnIndex)
columnIndex
- index of the Force.com column registered with this TableImpl
org.datanucleus.exceptions.NucleusException
- if the given index is out of boundspublic List<ColumnImpl> getListOfColumns()
public TableName getTableName()
public String toString()
toString
in class Object
public List<ColumnImpl> getColumnsFor(org.datanucleus.metadata.AbstractClassMetaData acmd, org.datanucleus.metadata.AbstractMemberMetaData ammd, ForceStoreManager storeManager, List<ColumnImpl> columns)
This method can handle embedded JPA metadata.
acmd
- JPA class metadataammd
- JPA field metadatastoreManager
- ForceStoreManagercolumns
- list which will collect all embedded Force.com columns
TableImpl
public ColumnImpl getColumnAt(org.datanucleus.metadata.AbstractClassMetaData acmd, int fieldNumber)
acmd
- JPA class metadatafieldNumber
- JPA field position
TableImpl
public ColumnImpl getColumnFor(org.datanucleus.metadata.AbstractClassMetaData acmd, org.datanucleus.metadata.AbstractMemberMetaData ammd)
acmd
- JPA class metadataammd
- JPA field metadata
TableImpl
org.datanucleus.exceptions.NucleusUserException
- if no Force.com column can be found for the given JPA field metadatapublic String getPKFieldName(org.datanucleus.metadata.AbstractClassMetaData acmd)
acmd
- JPA class metadata
public void createTableAndFields(org.datanucleus.metadata.AbstractClassMetaData cmd, ForceStoreManager storeManager, ForceManagedConnection mconn)
cmd
- the class metadata for the table being createdstoreManager
- the store managermconn
- the managed connection to the Force.com APIspublic void createFields(org.datanucleus.metadata.AbstractClassMetaData cmd, ForceStoreManager storeManager)
cmd
- the class metadata for the table containing the fields to be createdstoreManager
- the store managerpublic void refresh(com.sforce.soap.partner.DescribeSObjectResult result, ForceManagedConnection mconn)
result
- the describe result for this entitymconn
- the managed connection to the Force.com APIspublic boolean getTableAlreadyExistsInOrg()
public ForceTableMetaData getMetaData(org.datanucleus.metadata.AbstractClassMetaData cmd)
cmd
- JPA class metadata
ForceTableMetaData
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |