Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX - Problem of wrong serialization of ComposedKey fields on the cache #4032

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*******************************************************************************/
package org.eclipse.kapua.commons.service.internal.cache;

import org.eclipse.kapua.commons.model.id.KapuaEid;
import org.eclipse.kapua.model.id.KapuaId;

import java.io.Serializable;
Expand All @@ -26,7 +27,7 @@ public class ComposedKey implements Serializable {
private Serializable key;

public ComposedKey(KapuaId scopeId, Serializable key) {
this.scopeId = scopeId;
this.scopeId = KapuaEid.parseKapuaId(scopeId); //This is done in order to cast different implementations of KapuaId into one specific, to avoid problems with serialization
this.key = key;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public KapuaListResult removeList(KapuaId scopeId, Serializable id) {

/**
* Checks that the scopeId of the entity matches the provided one.
* This mimics the checks that are performed in the 'find' method of the {@link org.eclipse.kapua.commons.service.internal.ServiceDAO} class.
* This mimics the checks that are performed in the 'find' method of the {@link org.eclipse.kapua.commons.jpa.KapuaEntityJpaRepository} class.
*
* @param scopeId a {@link KapuaId} representing the scopeId
* @param entity the {@link KapuaEntity} to be checked
Expand All @@ -159,7 +159,7 @@ protected KapuaEntity checkResult(KapuaId scopeId, KapuaEntity entity) {

/**
* Checks that the scopeId of the entity matches the provided one.
* This mimics the checks that are performed in the 'find' method of the {@link org.eclipse.kapua.commons.service.internal.ServiceDAO} class.
* This mimics the checks that are performed in the 'find' method of the {@link org.eclipse.kapua.commons.jpa.KapuaEntityJpaRepository} class.
*
* @param scopeId a {@link KapuaId} representing the scopeId
* @param entity the {@link KapuaListResult} entity to be checked
Expand Down
Loading