org.soyatec.windowsazure.table
Class AbstractTableServiceEntity

java.lang.Object
  extended by org.soyatec.windowsazure.table.AbstractTableServiceEntity
All Implemented Interfaces:
ITableServiceEntity

public abstract class AbstractTableServiceEntity
extends java.lang.Object
implements ITableServiceEntity

This abstract class defines the common concepts of a table in Windows Azure. It represents an entity (row) in a table in table storage.

Two entries are considered to same when they have same PartitionKey and same RowKey in azure table service. This feature is used when update/merge/load entity from table service.


Constructor Summary
AbstractTableServiceEntity(java.lang.String partitionKey, java.lang.String rowKey)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getETag()
          Etag property
 java.lang.String getPartitionKey()
          The partition key of a table entity.
 java.lang.String getRowKey()
          The row key of a table entity.
 java.sql.Timestamp getTimestamp()
           
 java.util.List<ICloudTableColumn> getValues()
           
 int hashCode()
           
 boolean isSameEntity(ITableServiceEntity entity)
          Different with equals().
 void setETag(java.lang.String tag)
           
 void setPartitionKey(java.lang.String partitionKey)
          Set the partition key of a table entity.
 void setRowKey(java.lang.String rowKey)
          Set the row key of a table entity.
 void setTimestamp(java.sql.Timestamp timestamp)
          Set the Timestamp of entity.
 void setValues(java.util.List<ICloudTableColumn> values)
          Set the cloudTableColumn list of ITableServiceEntity.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTableServiceEntity

public AbstractTableServiceEntity(java.lang.String partitionKey,
                                  java.lang.String rowKey)
Method Detail

getValues

public java.util.List<ICloudTableColumn> getValues()
Specified by:
getValues in interface ITableServiceEntity
Returns:
cloudTableColumn list of ITableServiceEntity.

setValues

public void setValues(java.util.List<ICloudTableColumn> values)
Description copied from interface: ITableServiceEntity
Set the cloudTableColumn list of ITableServiceEntity.

Specified by:
setValues in interface ITableServiceEntity

getTimestamp

public java.sql.Timestamp getTimestamp()
Specified by:
getTimestamp in interface ITableServiceEntity
Returns:
the Timestamp of entity

setTimestamp

public void setTimestamp(java.sql.Timestamp timestamp)
Description copied from interface: ITableServiceEntity
Set the Timestamp of entity.

Specified by:
setTimestamp in interface ITableServiceEntity

getPartitionKey

public java.lang.String getPartitionKey()
Description copied from interface: ITableServiceEntity
The partition key of a table entity. The concatenation of the partition key and row key must be unique per table.

Specified by:
getPartitionKey in interface ITableServiceEntity

setPartitionKey

public void setPartitionKey(java.lang.String partitionKey)
Description copied from interface: ITableServiceEntity
Set the partition key of a table entity.

Specified by:
setPartitionKey in interface ITableServiceEntity

getRowKey

public java.lang.String getRowKey()
Description copied from interface: ITableServiceEntity
The row key of a table entity.

Specified by:
getRowKey in interface ITableServiceEntity

setRowKey

public void setRowKey(java.lang.String rowKey)
Description copied from interface: ITableServiceEntity
Set the row key of a table entity.

Specified by:
setRowKey in interface ITableServiceEntity

getETag

public java.lang.String getETag()
Description copied from interface: ITableServiceEntity
Etag property

A property generaged by table service when insert/modify the entity within table service. It should not be setting by users.

Specified by:
getETag in interface ITableServiceEntity

setETag

public void setETag(java.lang.String tag)

hashCode

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

equals

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

isSameEntity

public boolean isSameEntity(ITableServiceEntity entity)
Description copied from interface: ITableServiceEntity
Different with equals(). Two entieis are considered to same when they have same PartitionKey and same RowKey in azure table service. This feature is used when update/merge/load entity from table service.

Specified by:
isSameEntity in interface ITableServiceEntity
Returns:
True only if the entity's PartitionKey and RowKey are all same with given entity.