com.sap.ip.me.api.smartsync
Class BasisFieldType

java.lang.Object
  extended bycom.sap.ip.me.api.smartsync.BasisFieldType

public class BasisFieldType
extends java.lang.Object

An enumeration of possible basis field types for SmartSync. Each field type has a backend representation as well as a client representation.

To retrieve the FieldDescriptor instance on a certain delvDateField field.

FieldDesccriptor fieldDesc = delvDateField.getFieldDescriptor();

BasisFieldType basisFieldType = fieldDesc.getFieldType();

String backendRepresentation = basisFieldType.getBackendRepresentation();

The value of backendRepresentation will be 'D' as this is a date field. The values will be 'C','P','N','T' for the field types String, BigDecimal, BigInteger, java.sql.Time.

Class clientRepresentation = basisFieldType.getClientRepresentation();

The value of clientRepresentation will be java.sql.Date.class as this is a date field. The value will be String.class, BigDecimal.class, BigInteger.class, java.sql.Time.class for the field types String, BigDecimal, BigInteger, java.sql.Time.

AttributeType persistenceRepresentation = basisFieldType.getPersistenceRepresentation();

The value of persistenceRepresentation will be AttributeType.SQLDATE as this is a date field. The value will be AttributeType.STRING, AttributeType.BIGDECIMAL, AttributeType.BIGINTEGER, AttributeType.SQLTIME for the field types String, BigDecimal, BigInteger, java.sql.Time.

Version:
2.1
Author:
SAP
See Also:
FieldDescriptor

Field Summary
static BasisFieldType C
          A field type for fixed length characters; represented in the client as java.lang.String.
static BasisFieldType D
          A field type for date; represented in the client as java.sql.Date.
static BasisFieldType N
          A field type for numeric characters; represented in the client as BigInteger
static BasisFieldType P
          A field type for packet; represented in the client as BigDecimal.
static BasisFieldType T
          A field type for time; represented in the client as java.sql.Time
 
Method Summary
static BasisFieldType forString(java.lang.String fieldStringRep)
          Returns a BasisFieldType instance for the specified String representation of the field.
 java.lang.String getBackendRepresentation()
          Returns the backend representation: The value will be 'D','C','P','N','T' for the field types java.sql.Date,String, BigDecimal, BigInteger, java.sql.Time.
 java.lang.Class getClientRepresentation()
          Returns the client representation class of this BasisFieldType: The value will be java.sql.Date.class, String.class, BigDecimal.class, BigInteger.class, java.sql.Time.class for the field types java.sql.Date,String, BigDecimal, BigInteger, java.sql.Time.
 AttributeType getPersistenceRepresentation()
          Returns the persistence representation type of this BasisFieldType: The values will be AttributeType.SQLDATE ,AttributeType.STRING, AttributeType.BIGDECIMAL, AttributeType.BIGINTEGER, AttributeType.SQLTIME for the field types java.sql.Date,String, BigDecimal, BigInteger, java.sql.Time.
 java.lang.String toString()
          Returns the backend representation: The value will be 'D','C','P','N','T' for the field types java.sql.Date,String, BigDecimal, BigInteger, java.sql.Time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

C

public static BasisFieldType C
A field type for fixed length characters; represented in the client as java.lang.String.


D

public static BasisFieldType D
A field type for date; represented in the client as java.sql.Date.


P

public static BasisFieldType P
A field type for packet; represented in the client as BigDecimal.


N

public static BasisFieldType N
A field type for numeric characters; represented in the client as BigInteger


T

public static BasisFieldType T
A field type for time; represented in the client as java.sql.Time

Method Detail

forString

public static BasisFieldType forString(java.lang.String fieldStringRep)
Returns a BasisFieldType instance for the specified String representation of the field.

Parameters:
fieldStringRep - the string representation of the field; should be one of the following "C", "D" , "N" , "P", "T".
Returns:
a BasisFieldType instance for the specified String representation or null if the specified string is not on the list.

getBackendRepresentation

public java.lang.String getBackendRepresentation()
Returns the backend representation: The value will be 'D','C','P','N','T' for the field types java.sql.Date,String, BigDecimal, BigInteger, java.sql.Time.

Returns:
the backend representation in string

getClientRepresentation

public java.lang.Class getClientRepresentation()
Returns the client representation class of this BasisFieldType: The value will be java.sql.Date.class, String.class, BigDecimal.class, BigInteger.class, java.sql.Time.class for the field types java.sql.Date,String, BigDecimal, BigInteger, java.sql.Time.

Returns:
the client representation class

getPersistenceRepresentation

public AttributeType getPersistenceRepresentation()
Returns the persistence representation type of this BasisFieldType: The values will be AttributeType.SQLDATE ,AttributeType.STRING, AttributeType.BIGDECIMAL, AttributeType.BIGINTEGER, AttributeType.SQLTIME for the field types java.sql.Date,String, BigDecimal, BigInteger, java.sql.Time.

Returns:
The persistence representation type of this BasisFieldType.
See Also:
AttributeType

toString

public java.lang.String toString()
Returns the backend representation: The value will be 'D','C','P','N','T' for the field types java.sql.Date,String, BigDecimal, BigInteger, java.sql.Time.

Returns:
Description of the Return Value


Copyright © 2003 SAP AG. All Rights Reserved.