org.opensubsystems.patterns.mappeddata.data
Class MappedData

java.lang.Object
  extended by org.opensubsystems.core.data.DataObject
      extended by org.opensubsystems.core.data.BasicDataObject
          extended by org.opensubsystems.core.data.ModifiableDataObject
              extended by org.opensubsystems.patterns.mappeddata.data.MappedData
All Implemented Interfaces:
java.io.Serializable

public class MappedData
extends org.opensubsystems.core.data.ModifiableDataObject

Mapped data object represents relationship between two data objects by identifying the two data objects in the relationship, the type of relationship as well as storing any additional data connected with this relationship..

Version:
$Id: MappedData.java,v 1.6 2007/01/28 06:54:51 bastafidli Exp $
Author:
Julian Legeny
See Also:
Serialized Form
Code reviewer:
Miro Halas
Code reviewed:
1.2 2006/06/29 00:26:42 jlegeny

Field Summary
static int[] ALL_MAPPEDDATA_COLUMNS
          Static variable for array of all columns codes.
static int COL_MAPPEDDATA_CREATION_DATE
          Code for table column.
static int COL_MAPPEDDATA_CUSTOM_DATA
          Code for table column.
static java.lang.Integer COL_MAPPEDDATA_CUSTOM_DATA_OBJ
          Object code for table column.
static int COL_MAPPEDDATA_ID
          Code for table column.
static java.lang.Integer COL_MAPPEDDATA_ID_OBJ
          Object code for table column.
static int COL_MAPPEDDATA_ID1
          Code for table column.
static java.lang.Integer COL_MAPPEDDATA_ID1_OBJ
          Object code for table column.
static int COL_MAPPEDDATA_ID2
          Code for table column.
static java.lang.Integer COL_MAPPEDDATA_ID2_OBJ
          Object code for table column.
static java.lang.Integer COL_MAPPEDDATA_MAPPED_TYPE_OBJ
          Object code for table column.
static int COL_MAPPEDDATA_MAPPING_TYPE
          Code for table column.
static int COL_MAPPEDDATA_MODIFICATION_DATE
          Code for table column.
static int[] DEFAULT_LIST_COLUMNS
          List of columns which should be retrieved from persistence store by default.
protected  int m_iMappedId1
          Id of the first data object in the relation.
protected  int m_iMappedId2
          Id of the second data object in the relation.
protected  int m_iMappingType
          Mapping type.
protected  java.lang.String m_strCustomData
          Custom data to store together with the relation.
static int MAPPING_TYPE_SELFREG
          Mapping type of domain-survey schema that identify selfregistration data.
protected static int s_iCustomDataMaxLength
          Maximal length of the custom data field.
 
Fields inherited from class org.opensubsystems.core.data.ModifiableDataObject
m_modificationTimestamp
 
Fields inherited from class org.opensubsystems.core.data.BasicDataObject
m_creationTimestamp, m_iDomainId
 
Fields inherited from class org.opensubsystems.core.data.DataObject
NEW_ID, NEW_ID_OBJ, NEW_ID_STR
 
Constructor Summary
MappedData()
          Empty mapped data initialized to default parameters Note: We do not allow to specify domain id because mapped data doesn't exist in domain.
MappedData(int iId, int iMappedId1, int iMappedId2, int iMappedType, java.lang.String strCustomData, java.sql.Timestamp creationTimestamp, java.sql.Timestamp modificationTimestamp)
          Create mapped data from a given parameters.
 
Method Summary
 java.lang.String getCustomData()
           
 int getCustomDataMaxLength()
           
static int getCustomDataMaxLengthStatic()
           
 int getMappedId1()
           
 int getMappedId2()
           
 int getMappingType()
           
 boolean isSame(java.lang.Object oObject)
          
 void setCustomData(java.lang.String customData)
           
static void setCustomDataMaxLength(int iCustomData)
          Maximal length for custom data.
 void setMappedId1(int mappedId1)
           
 void setMappedId2(int mappedId2)
           
 void setMappingType(int mappingType)
           
 
Methods inherited from class org.opensubsystems.core.data.ModifiableDataObject
equals, getModificationTimestamp, hashCode, restore, setModificationTimestamp
 
Methods inherited from class org.opensubsystems.core.data.BasicDataObject
getCreationTimestamp, getDomainId, getId, getIdAsObject, restore, setCreationTimestamp, setId
 
Methods inherited from class org.opensubsystems.core.data.DataObject
isFromPersistenceStore, setFromPersistenceStore
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COL_MAPPEDDATA_ID

public static final int COL_MAPPEDDATA_ID
Code for table column.

See Also:
Constant Field Values

COL_MAPPEDDATA_ID_OBJ

public static final java.lang.Integer COL_MAPPEDDATA_ID_OBJ
Object code for table column.


COL_MAPPEDDATA_ID1

public static final int COL_MAPPEDDATA_ID1
Code for table column.

See Also:
Constant Field Values

COL_MAPPEDDATA_ID1_OBJ

public static final java.lang.Integer COL_MAPPEDDATA_ID1_OBJ
Object code for table column.


COL_MAPPEDDATA_ID2

public static final int COL_MAPPEDDATA_ID2
Code for table column.

See Also:
Constant Field Values

COL_MAPPEDDATA_ID2_OBJ

public static final java.lang.Integer COL_MAPPEDDATA_ID2_OBJ
Object code for table column.


COL_MAPPEDDATA_MAPPING_TYPE

public static final int COL_MAPPEDDATA_MAPPING_TYPE
Code for table column.

See Also:
Constant Field Values

COL_MAPPEDDATA_MAPPED_TYPE_OBJ

public static final java.lang.Integer COL_MAPPEDDATA_MAPPED_TYPE_OBJ
Object code for table column.


COL_MAPPEDDATA_CUSTOM_DATA

public static final int COL_MAPPEDDATA_CUSTOM_DATA
Code for table column.

See Also:
Constant Field Values

COL_MAPPEDDATA_CUSTOM_DATA_OBJ

public static final java.lang.Integer COL_MAPPEDDATA_CUSTOM_DATA_OBJ
Object code for table column.


COL_MAPPEDDATA_CREATION_DATE

public static final int COL_MAPPEDDATA_CREATION_DATE
Code for table column.

See Also:
Constant Field Values

COL_MAPPEDDATA_MODIFICATION_DATE

public static final int COL_MAPPEDDATA_MODIFICATION_DATE
Code for table column.

See Also:
Constant Field Values

ALL_MAPPEDDATA_COLUMNS

public static final int[] ALL_MAPPEDDATA_COLUMNS
Static variable for array of all columns codes. The order is important since it is used to retrieve all data from the persistence store efficiently so do not modify it unless you make changes to other places as well.


DEFAULT_LIST_COLUMNS

public static final int[] DEFAULT_LIST_COLUMNS
List of columns which should be retrieved from persistence store by default. These should be only columns visible to user on the screen and not any internal columns. Also the columns should be retrievable efficiently so that the default view is very quick.


MAPPING_TYPE_SELFREG

public static final int MAPPING_TYPE_SELFREG
Mapping type of domain-survey schema that identify selfregistration data. TODO: For Julo: This doesn't belong here: This should be in DomainSurvey object or controller which uses it..

See Also:
Constant Field Values

s_iCustomDataMaxLength

protected static int s_iCustomDataMaxLength
Maximal length of the custom data field. The value depends on the underlying persistence mechanism and it is set once the persistance layer is initialized.


m_iMappedId1

protected int m_iMappedId1
Id of the first data object in the relation.


m_iMappedId2

protected int m_iMappedId2
Id of the second data object in the relation.


m_iMappingType

protected int m_iMappingType
Mapping type. By specifying different values it is possible to create multiple different relations between the same dataobjects.


m_strCustomData

protected java.lang.String m_strCustomData
Custom data to store together with the relation. This could be data further classifying the relation between the specified data objects.

Constructor Detail

MappedData

public MappedData()
Empty mapped data initialized to default parameters Note: We do not allow to specify domain id because mapped data doesn't exist in domain.


MappedData

public MappedData(int iId,
                  int iMappedId1,
                  int iMappedId2,
                  int iMappedType,
                  java.lang.String strCustomData,
                  java.sql.Timestamp creationTimestamp,
                  java.sql.Timestamp modificationTimestamp)
Create mapped data from a given parameters. Note: We do not allow to specify domain id because mapped data doesn't exist in domain.

Parameters:
iId - - Unique ID identifying this mapped data.
iMappedId1 - - Mapped ID 1.
iMappedId2 - - Mapped ID 2.
iMappedType - - Mapped type.
strCustomData - - Custom data.
creationTimestamp - - Timestamp when the mapped data was created
modificationTimestamp - - Timestamp when the mapped data was last time modified
Method Detail

getMappedId1

public int getMappedId1()
Returns:
int

setMappedId1

public void setMappedId1(int mappedId1)
Parameters:
mappedId1 - - new mapped ID 1

getMappedId2

public int getMappedId2()
Returns:
int

setMappedId2

public void setMappedId2(int mappedId2)
Parameters:
mappedId2 - - new mapped ID 2

getMappingType

public int getMappingType()
Returns:
int

setMappingType

public void setMappingType(int mappingType)
Parameters:
mappingType - - new mapped type

getCustomData

public java.lang.String getCustomData()
Returns:
String

setCustomData

public void setCustomData(java.lang.String customData)
Parameters:
customData - - new cutom data for mapped table

getCustomDataMaxLength

public int getCustomDataMaxLength()
Returns:
int

getCustomDataMaxLengthStatic

public static int getCustomDataMaxLengthStatic()
Returns:
int

setCustomDataMaxLength

public static void setCustomDataMaxLength(int iCustomData)
Maximal length for custom data.

Parameters:
iCustomData - - maximal length of the custom data in the persistence store

isSame

public boolean isSame(java.lang.Object oObject)

Specified by:
isSame in class org.opensubsystems.core.data.DataObject


Copyright © 2003 - 2006 OpenSubsystems s.r.o.