org.directwebremoting.io
Class ItemUpdate

java.lang.Object
  extended by org.directwebremoting.io.ItemUpdate

public class ItemUpdate
extends java.lang.Object

Analogous to a Map.Entry that we use to pass objects that have been stored in a StoreProvider to the Internet. TODO: Consider if we should add version field to this so we can add some sort of pessimistic locking to updates.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
ItemUpdate(java.lang.String itemId, java.lang.String attribute, RawData newValue)
          Create an Item with its ID and data.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAttribute()
          Accessor for the property that we want to change on the Object with the ID given in itemId.
 java.lang.String getItemId()
          Accessor for the primary key for this Object.
 RawData getNewValue()
          Accessor for the value for the attribute that we want to change on the Object with the ID given in itemId.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItemUpdate

public ItemUpdate(java.lang.String itemId,
                  java.lang.String attribute,
                  RawData newValue)
Create an Item with its ID and data.

Method Detail

getItemId

public java.lang.String getItemId()
Accessor for the primary key for this Object. Clearly not all database primary keys are Strings, my current feeling is that the majority of database primary keys can either be simply mapped to strings, or are a bad idea anyway.

Warning: It would be a bad idea to expose database primary keys directly to the Internet anyway, so some form of mapping is required.

Returns:
The primary key for this Object

getAttribute

public java.lang.String getAttribute()
Accessor for the property that we want to change on the Object with the ID given in itemId.


getNewValue

public RawData getNewValue()
Accessor for the value for the attribute that we want to change on the Object with the ID given in itemId.


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

Copyright 2008