Package de.hybris.platform.tx
Class AfterSaveEventUtils
java.lang.Object
de.hybris.platform.tx.AfterSaveEventUtils
Utility class to encode the entity changes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<AfterSaveEvent>createEventsFromChanges(byte[][] changes) Creates the effective set ofAfterSaveEventobjects from a array of encoded changes ( which are byte arrays as well).static Collection<AfterSaveEvent>createEventsFromChanges(byte[][] changes, boolean removeUnnecessaryTypes) Creates the effective set ofAfterSaveEventobjects from a array of encoded changes ( which are byte arrays as well).static intdecodeChangeTypes(byte[] encodedChanges) Decoded changes from encoded changes byte array.static PKdecodePK(byte[] encodedChanges) Decoded PK from encoded changes byte array.static byte[]encodeChanges(PK pk, int types) Encodes several changes of one PK into a byte array.
-
Constructor Details
-
AfterSaveEventUtils
public AfterSaveEventUtils()
-
-
Method Details
-
encodeChanges
Encodes several changes of one PK into a byte array.- Returns:
- a byte array and its length is 9. The first eight bytes store the long value of PK, and the last one contains the type information.
- See Also:
-
decodePK
Decoded PK from encoded changes byte array.- Returns:
- the decoded PK from the byte array.
- See Also:
-
decodeChangeTypes
public static int decodeChangeTypes(byte[] encodedChanges) Decoded changes from encoded changes byte array.- Returns:
- the type change information
- See Also:
-
createEventsFromChanges
Creates the effective set ofAfterSaveEventobjects from a array of encoded changes ( which are byte arrays as well).Please note that unnecessary change types are silently removed.
- Returns:
- all
AfterSaveEvents
-
createEventsFromChanges
public static Collection<AfterSaveEvent> createEventsFromChanges(byte[][] changes, boolean removeUnnecessaryTypes) Creates the effective set ofAfterSaveEventobjects from a array of encoded changes ( which are byte arrays as well).- Parameters:
removeUnnecessaryTypes- iftruechange types that are considered unnecessary are not translated into events. These are: any UPDATE which has a matching REMOVE; any UPDATE that has a matching CREATE and no REMOVE.- Returns:
- all
AfterSaveEvents
-