mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-07-22 17:01:41 +00:00
This commit is contained in:
parent
e141ab29db
commit
ef51fc8dbd
@ -24,7 +24,9 @@ import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
@ -36,6 +38,7 @@ import org.jdbi.v3.sqlobject.CreateSqlObject;
|
||||
import org.jdbi.v3.sqlobject.config.RegisterRowMapper;
|
||||
import org.jdbi.v3.sqlobject.customizer.Bind;
|
||||
import org.jdbi.v3.sqlobject.customizer.BindList;
|
||||
import org.jdbi.v3.sqlobject.customizer.BindMap;
|
||||
import org.jdbi.v3.sqlobject.customizer.Define;
|
||||
import org.jdbi.v3.sqlobject.statement.SqlQuery;
|
||||
import org.jdbi.v3.sqlobject.statement.SqlUpdate;
|
||||
@ -1454,12 +1457,14 @@ public interface CollectionDAO {
|
||||
|
||||
default void deleteAllByPrefix(String fqnPrefix) {
|
||||
String prefix = String.format("%s%s%%", fqnPrefix, Entity.SEPARATOR);
|
||||
String cond = String.format("WHERE (toFQN LIKE '%s' OR fromFQN LIKE '%s')", prefix, prefix);
|
||||
deleteAllByPrefixInternal(cond);
|
||||
String condition = "WHERE (toFQN LIKE :prefix OR fromFQN LIKE :prefix)";
|
||||
Map<String, String> bindMap = new HashMap<>();
|
||||
bindMap.put("prefix", prefix);
|
||||
deleteAllByPrefixInternal(condition, bindMap);
|
||||
}
|
||||
|
||||
@SqlUpdate("DELETE from field_relationship <cond>")
|
||||
void deleteAllByPrefixInternal(@Define("cond") String cond);
|
||||
void deleteAllByPrefixInternal(@Define("cond") String cond, @BindMap Map<String, String> bindings);
|
||||
|
||||
@SqlUpdate(
|
||||
"DELETE from field_relationship WHERE fromFQN = :fromFQN AND toFQN = :toFQN AND fromType = :fromType "
|
||||
|
@ -246,7 +246,7 @@ public class GlossaryTermResourceTest extends EntityResourceTest<GlossaryTerm, C
|
||||
TagLabel t1Label = EntityUtil.getTagLabel(t1);
|
||||
|
||||
// Create glossary term t11 under t1
|
||||
create = createRequest("t11", "", "", null).withReviewers(null).withGlossary(g1Ref).withParent(tRef1);
|
||||
create = createRequest("t11with'quote", "", "", null).withReviewers(null).withGlossary(g1Ref).withParent(tRef1);
|
||||
GlossaryTerm t11 = createEntity(create, ADMIN_AUTH_HEADERS);
|
||||
EntityReference tRef11 = t11.getEntityReference();
|
||||
TagLabel t11Label = EntityUtil.getTagLabel(t11);
|
||||
|
Loading…
x
Reference in New Issue
Block a user