|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.log.EntityDetails
public class EntityDetails
Contains detailed information about the changes made to an
entity during a transaction. This information is sent to
an EntityLogger
that is responsible for the actual
logging.
NOTE! The information in this object is more or less drawn from what Hibernate reveals about the entity. It is recommended that no information is changed.
Field Summary | |
---|---|
private ChangeType |
changeType
|
private int[] |
dirty
|
private Object |
entity
|
private EntityLogger |
logger
|
private Object[] |
previousState
|
private String[] |
properties
|
private Object[] |
state
|
private org.hibernate.type.Type[] |
types
|
Constructor Summary | |
---|---|
EntityDetails(EntityLogger logger,
Object entity,
ChangeType changeType,
Object[] state,
Object[] previousState,
String[] properties,
org.hibernate.type.Type[] types)
|
Method Summary | |
---|---|
private void |
findDirtyCollections()
We must do this from the constructor since the "dirtyness" of a collection is reset after flush the SQL to the database, which is completed before the rest of the logging is done. |
ChangeType |
getChangeType()
Was it a creation/update/deletion? |
Object |
getEntity()
Get the entity that was changed. |
EntityLogger |
getEntityLogger()
Get the entity logger that handles the logging for this event. |
String |
getModifiedProperties(String prefix,
String separator,
String suffix)
Get all modified properties as a string, separating each property name with the given separator. |
Object[] |
getPreviousState()
Get an array with the previous state of the entity. |
String[] |
getProperties()
Get an array with the names of all properties. |
Object[] |
getState()
Get an array with the current state of the entity. |
org.hibernate.type.Type[] |
getTypes()
Get an array representing the data type for each property. |
ChangeHistoryDetailData |
toChangeHistoryDetailData(BasicData data,
ChangeType changeType,
boolean detailedProperties)
Create a new ChangeHistoryDetailData object using a mix of the information in this object, and the given parameters. |
ChangeHistoryDetailData |
toChangeHistoryDetailData(boolean detailedProperties)
Create a new ChangeHistoryDetailData object from the information in this object assuming that the entity is a subclass of BasicData . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final EntityLogger logger
private final Object entity
private final ChangeType changeType
private final Object[] state
private final Object[] previousState
private final String[] properties
private final org.hibernate.type.Type[] types
private final int[] dirty
Constructor Detail |
---|
public EntityDetails(EntityLogger logger, Object entity, ChangeType changeType, Object[] state, Object[] previousState, String[] properties, org.hibernate.type.Type[] types)
Method Detail |
---|
public EntityLogger getEntityLogger()
public Object getEntity()
public ChangeType getChangeType()
public Object[] getState()
public Object[] getPreviousState()
getState()
for delete events.
public String[] getProperties()
public org.hibernate.type.Type[] getTypes()
public String getModifiedProperties(String prefix, String separator, String suffix)
prefix
- A string that is added first in the result, or nullseparator
- A separator string (if null, comma is used)suffix
- A string that is added last in the result, or null
public ChangeHistoryDetailData toChangeHistoryDetailData(boolean detailedProperties)
BasicData
.
detailedProperties
- If TRUE, the ChangeHistoryDetailData.getChangeInfo()
is populated with a list of the names of the modified properties (only
relevant for UPDATE changes)
public ChangeHistoryDetailData toChangeHistoryDetailData(BasicData data, ChangeType changeType, boolean detailedProperties)
data
- The entity that was changedchangeType
- The change typedetailedProperties
- If TRUE, the ChangeHistoryDetailData.getChangeInfo()
is populated with a list of the names of the modified properties (only
relevant for UPDATE changes)
private void findDirtyCollections()
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |