From 2146e2e4576416e4faa04601c1ad2bb448c0dd84 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Mon, 3 Oct 2022 16:14:23 -0700 Subject: [PATCH] Remove tags. --- config/database/hsql/create-schemas.sql | 9 --------- config/database/hsql/drop-schemas.sql | 1 - .../com/wisemapping/dao/MindmapManagerImpl.java | 7 ------- .../java/com/wisemapping/model/MindMapCriteria.java | 13 +------------ .../src/main/java/com/wisemapping/model/User.java | 13 ------------- 5 files changed, 1 insertion(+), 42 deletions(-) diff --git a/config/database/hsql/create-schemas.sql b/config/database/hsql/create-schemas.sql index defde9fe..3e98ae79 100644 --- a/config/database/hsql/create-schemas.sql +++ b/config/database/hsql/create-schemas.sql @@ -27,7 +27,6 @@ CREATE TABLE MINDMAP ( creation_date DATETIME, edition_date DATETIME, creator_id INTEGER NOT NULL, - tags VARCHAR(1014), last_editor_id INTEGER NOT NULL --FOREIGN KEY(creator_id) REFERENCES USER(colaborator_id) ); @@ -76,14 +75,6 @@ CREATE TABLE COLLABORATION ( FOREIGN KEY (properties_id) REFERENCES COLLABORATION_PROPERTIES (id) ); - -CREATE TABLE TAG ( - id INTEGER NOT NULL IDENTITY, - name VARCHAR(255) NOT NULL, - user_id INTEGER NOT NULL, ---FOREIGN KEY(user_id) REFERENCES USER(colaborator_id) -); - CREATE TABLE ACCESS_AUDITORY ( id INTEGER NOT NULL IDENTITY, user_id INTEGER NOT NULL, diff --git a/config/database/hsql/drop-schemas.sql b/config/database/hsql/drop-schemas.sql index 701bb2c8..22dc8016 100644 --- a/config/database/hsql/drop-schemas.sql +++ b/config/database/hsql/drop-schemas.sql @@ -1,5 +1,4 @@ DROP TABLE IF EXISTS ACCESS_AUDITORY; -DROP TABLE IF EXISTS TAG; DROP TABLE IF EXISTS COLLABORATION; DROP TABLE IF EXISTS COLLABORATION_PROPERTIES; DROP TABLE IF EXISTS MINDMAP_HISTORY; diff --git a/wise-webapp/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java b/wise-webapp/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java index ce465a38..907a3a5e 100644 --- a/wise-webapp/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java @@ -148,13 +148,6 @@ public class MindmapManagerImpl final SimpleExpression descriptionRestriction = Restrictions.like("description", "%" + criteria.getDescription() + "%"); junction.add(descriptionRestriction); } - if (criteria.getTags().size() > 0) { - for (String tag : criteria.getTags()) { - final SimpleExpression tagRestriction = Restrictions.like("tags", "%" + tag + "%"); - junction.add(tagRestriction); - } - } - hibernateCriteria.add(junction); } return hibernateCriteria.list(); diff --git a/wise-webapp/src/main/java/com/wisemapping/model/MindMapCriteria.java b/wise-webapp/src/main/java/com/wisemapping/model/MindMapCriteria.java index 05f88d7f..c57f3c21 100644 --- a/wise-webapp/src/main/java/com/wisemapping/model/MindMapCriteria.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/MindMapCriteria.java @@ -24,7 +24,6 @@ import java.util.List; public class MindMapCriteria { private String title; private String description; - private List tags = new ArrayList(); private boolean orConnector = false; private int pageNro = 0; @@ -41,18 +40,9 @@ public class MindMapCriteria { this.pageNro = page; } - public List getTags() { - return tags; - } - - public void setTags(List tags) { - this.tags = tags; - } - public String getTitle() { return title; } - public void setTitle(String title) { this.title = title; } @@ -78,8 +68,7 @@ public class MindMapCriteria { } public boolean isEmpty() { - return !(getTags() != null && !getTags().isEmpty() || getTitle() != null || getDescription() != null); + return getTitle() != null || getDescription() != null; } - public static MindMapCriteria EMPTY_CRITERIA = new MindMapCriteria(); } diff --git a/wise-webapp/src/main/java/com/wisemapping/model/User.java b/wise-webapp/src/main/java/com/wisemapping/model/User.java index 53b7c3e8..1a5a557d 100644 --- a/wise-webapp/src/main/java/com/wisemapping/model/User.java +++ b/wise-webapp/src/main/java/com/wisemapping/model/User.java @@ -57,22 +57,9 @@ public class User @Column(name = "authenticator_uri") private String authenticatorUri; - @ElementCollection - @CollectionTable(name = "TAG", joinColumns = @JoinColumn(name = "user_id")) - @Column(name = "name") - private Set tags = new HashSet<>(); - public User() { } - public void setTags(Set tags) { - this.tags = tags; - } - - public Set getTags() { - return tags; - } - public String getFullName() { return this.getFirstname() + " " + this.getLastname(); }