|
|||||||||
| Home >> All >> com >> RuntimeCollective >> webapps >> [ bean overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.RuntimeCollective.webapps.bean
Class AuditedExtension

java.lang.Objectcom.RuntimeCollective.webapps.bean.AuditedExtension
- All Implemented Interfaces:
- EntityBean, java.io.Serializable
- public class AuditedExtension
- extends java.lang.Object
- implements EntityBean
- extends java.lang.Object
This Extension can be used to collect creation/lastModified user/date on any EntityBean.
To set audit data, simply user markAsCreated and markAsEdited.
To view the data, getFor() the extension, and use its properties.
- Version:
- $Id: AuditedExtension.java,v 1.5 2003/09/30 15:13:09 joe Exp $
| Fields inherited from interface com.RuntimeCollective.webapps.bean.EntityBean |
INTERFACE_BEAN, NULL_ID |
| Constructor Summary | |
AuditedExtension()
Constructs a new blank bean with a unique id. |
|
AuditedExtension(int id)
Gets a bean from the RuntimeDataSource, given an id. |
|
| Method Summary | |
void |
delete()
Delete this bean from the database. |
java.util.Date |
getCreationDate()
Get the creation date. |
User |
getCreationUser()
Get the creationUser. |
EntityBean |
getEntityBean()
Gets the bean. |
static AuditedExtension |
getFor(EntityBean bean)
Gets the AuditedExtension for a particular bean. |
int |
getId()
Get the unique id of this bean instance. |
java.util.Date |
getLastModifiedDate()
Get the last modified date. |
User |
getLastModifiedUser()
Get the lastModifiedUser. |
static AuditedExtension |
getOrCreateFor(EntityBean bean)
Gets the AuditedExtension for a particular bean. |
static void |
markAsCreated(EntityBean bean,
User user)
Get or create an AuditedExtension for the bean, sets the Creation data, and save the extension. |
static void |
markAsCreated(EntityBean bean,
User user,
boolean createIfNecessary)
Get an AuditedExtension for the bean, sets the Creation data, and save the extension. |
static void |
markAsEdited(EntityBean bean,
User user)
Get or create an AuditedExtension for the bean, sets the LastModified data, and save the extension. |
static void |
markAsEdited(EntityBean bean,
User user,
boolean createIfNecessary)
Get an AuditedExtension for the bean, sets the LastModified data, and save the extension. |
void |
save()
Save this bean in the database. |
void |
setCreationDate(java.util.Date date)
Set the creation date. |
void |
setCreationUser(User creationUser)
Set the creationUser. |
void |
setEntityBean(EntityBean bean)
Sets the bean. |
void |
setId(int id)
Set the unique id of this bean instance. |
void |
setLastModifiedDate(java.util.Date date)
Set the last modified date bean |
void |
setLastModifiedUser(User user)
Set the lastModifiedUser. |
java.lang.String |
toString()
Convert this Object to a human-readable String. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
SELECT_ID
private static final java.lang.String SELECT_ID
- See Also:
- Constant Field Values
WHERE_BEAN_ID
private static final java.lang.String WHERE_BEAN_ID
- See Also:
- Constant Field Values
DELETE_FROM
private static final java.lang.String DELETE_FROM
- See Also:
- Constant Field Values
WHERE_ID
private static final java.lang.String WHERE_ID
- See Also:
- Constant Field Values
SELECT_DATA
private static final java.lang.String SELECT_DATA
- See Also:
- Constant Field Values
UPDATE
private static final java.lang.String UPDATE
- See Also:
- Constant Field Values
ESC
private static final java.lang.String ESC
- See Also:
- Constant Field Values
EMPTY_STRING
private static final java.lang.String EMPTY_STRING
- See Also:
- Constant Field Values
SPACE
private static final java.lang.String SPACE
- See Also:
- Constant Field Values
DATABASE_TABLE
public static final java.lang.String DATABASE_TABLE
- See Also:
- Constant Field Values
FIELD_BEAN_ID
private static final java.lang.String FIELD_BEAN_ID
- See Also:
- Constant Field Values
FIELD_CREATION_USER
private static final java.lang.String FIELD_CREATION_USER
- See Also:
- Constant Field Values
FIELD_CREATION_DATE
private static final java.lang.String FIELD_CREATION_DATE
- See Also:
- Constant Field Values
FIELD_LAST_MODIFIED_USER
private static final java.lang.String FIELD_LAST_MODIFIED_USER
- See Also:
- Constant Field Values
FIELD_LAST_MODIFIED_DATE
private static final java.lang.String FIELD_LAST_MODIFIED_DATE
- See Also:
- Constant Field Values
id
protected int id
- This bean's id
beanId
protected int beanId
- The id of the EntityBean this AuditedExtension is for.
creationUserId
protected int creationUserId
- The creationUser.
creationDate
protected java.util.Date creationDate
- The creation date bean
lastModifiedUserId
protected int lastModifiedUserId
- The lastModifiedUser
lastModifiedDate
protected java.util.Date lastModifiedDate
- The last modified date.
| Constructor Detail |
AuditedExtension
public AuditedExtension()
throws java.sql.SQLException
- Constructs a new blank bean with a unique id.
AuditedExtension
public AuditedExtension(int id)
throws java.sql.SQLException
- Gets a bean from the RuntimeDataSource, given an id.
| Method Detail |
setId
public void setId(int id)
- Set the unique id of this bean instance.
- Specified by:
setIdin interfaceEntityBean
getId
public int getId()
- Get the unique id of this bean instance.
- Specified by:
getIdin interfaceEntityBean
save
public void save()
- Save this bean in the database.
- Specified by:
savein interfaceEntityBean
delete
public void delete()
- Delete this bean from the database.
- Specified by:
deletein interfaceEntityBean
getEntityBean
public EntityBean getEntityBean()
- Gets the bean.
setEntityBean
public void setEntityBean(EntityBean bean)
- Sets the bean.
setCreationUser
public void setCreationUser(User creationUser)
- Set the creationUser.
getCreationUser
public User getCreationUser()
- Get the creationUser.
setCreationDate
public void setCreationDate(java.util.Date date)
- Set the creation date.
getCreationDate
public java.util.Date getCreationDate()
- Get the creation date.
setLastModifiedUser
public void setLastModifiedUser(User user)
- Set the lastModifiedUser.
getLastModifiedUser
public User getLastModifiedUser()
- Get the lastModifiedUser.
setLastModifiedDate
public void setLastModifiedDate(java.util.Date date)
- Set the last modified date bean
getLastModifiedDate
public java.util.Date getLastModifiedDate()
- Get the last modified date.
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object - Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string concatenation with this object. If the result is
null, string concatenation will instead use"null".The default implementation returns
getClass().getName() + "@" + Integer.toHexString(hashCode()).
getFor
public static AuditedExtension getFor(EntityBean bean)
- Gets the AuditedExtension for a particular bean.
getOrCreateFor
public static AuditedExtension getOrCreateFor(EntityBean bean)
- Gets the AuditedExtension for a particular bean. Create (and save) it if necessary.
markAsCreated
public static void markAsCreated(EntityBean bean, User user)
- Get or create an AuditedExtension for the bean, sets the Creation data,
and save the extension. Assumes the bean has been saved at least once.
markAsCreated
public static void markAsCreated(EntityBean bean, User user, boolean createIfNecessary)
- Get an AuditedExtension for the bean, sets the Creation data,
and save the extension. Assumes the bean has been saved at least once.
If createIfNecessary == false and the bean has no AuditedExtension, nothing happens.
markAsEdited
public static void markAsEdited(EntityBean bean, User user)
- Get or create an AuditedExtension for the bean, sets the LastModified data,
and save the extension. Assumes the bean has been saved at least once.
markAsEdited
public static void markAsEdited(EntityBean bean, User user, boolean createIfNecessary)
- Get an AuditedExtension for the bean, sets the LastModified data,
and save the extension. Assumes the bean has been saved at least once.
If createIfNecessary == false and the bean has no AuditedExtension, nothing happens.
|
|||||||||
| Home >> All >> com >> RuntimeCollective >> webapps >> [ bean overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.RuntimeCollective.webapps.bean.AuditedExtension