mirror of
https://github.com/datahub-project/datahub.git
synced 2025-09-02 22:03:11 +00:00
fix(recommendations): Check whether an entity exists before recommending (#5163)
This commit is contained in:
parent
66b9676567
commit
0c619ff393
@ -74,10 +74,15 @@ public class EntityUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if entity is removed (removed=true in Status aspect)
|
* Check if entity is removed (removed=true in Status aspect) and exists
|
||||||
*/
|
*/
|
||||||
public static boolean checkIfRemoved(EntityService entityService, Urn entityUrn) {
|
public static boolean checkIfRemoved(EntityService entityService, Urn entityUrn) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
if (!entityService.exists(entityUrn)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
EnvelopedAspect statusAspect =
|
EnvelopedAspect statusAspect =
|
||||||
entityService.getLatestEnvelopedAspect(entityUrn.getEntityType(), entityUrn, "status");
|
entityService.getLatestEnvelopedAspect(entityUrn.getEntityType(), entityUrn, "status");
|
||||||
if (statusAspect == null) {
|
if (statusAspect == null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user