Commit 4a48cade authored by Valentin Suhnjov's avatar Valentin Suhnjov

Merge branch 'releases/release-0.2.0' into master

parents baef9795 648ca746
......@@ -38,7 +38,6 @@ deploy_development:
environment:
name: development
url: http://$SSH_HOST:$PORT/
only:
- develop
when: manual
tags:
- riha
\ No newline at end of file
......@@ -5,7 +5,7 @@
<groupId>ee.eesti.riha</groupId>
<artifactId>rest</artifactId>
<version>0.1.0</version>
<version>0.2.0</version>
<packaging>war</packaging>
......
......@@ -320,7 +320,7 @@ GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE riha.document TO riha;
CREATE TABLE riha.comment
(
comment_id integer NOT NULL, -- Kommentaari unikaalne ID.
uri character varying(50) NOT NULL, -- Kommentaari unikaalne URI. See on ühine kogu ühe kommentaari hierarhiale
uri character varying(50), -- Kommentaari unikaalne URI. See on ühine kogu ühe kommentaari hierarhiale
comment_parent_id integer, -- Kui on tegemist hierarhilise kommentaariumiga, siis viitab vanemale
organization character varying(50), -- Kommentaari loonud ettevõtte kood
json_content jsonb, -- Kommentaari väljade esitus json formaadis.
......@@ -334,7 +334,8 @@ CREATE TABLE riha.comment
modifier character varying(150), -- Kirjet viimati muutnud isiku isikukood või muu identifikaator
creation_date timestamp without time zone, -- Kirje tekitamise ajamoment.
modified_date timestamp without time zone, -- Kirje viimase muutmise ajamoment.
kind character varying(150) NOT NULL,
kind character varying(150),
infosystem_uuid UUID NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
CONSTRAINT pk_comment PRIMARY KEY (comment_id),
CONSTRAINT fk_comment_comment FOREIGN KEY (comment_parent_id)
REFERENCES riha.comment (comment_id) MATCH SIMPLE
......@@ -360,6 +361,7 @@ COMMENT ON COLUMN riha.comment.creator IS 'Kirje tekitanud isiku isikukood või
COMMENT ON COLUMN riha.comment.modifier IS 'Kirjet viimati muutnud isiku isikukood või muu identifikaator';
COMMENT ON COLUMN riha.comment.creation_date IS 'Kirje tekitamise ajamoment.';
COMMENT ON COLUMN riha.comment.modified_date IS 'Kirje viimase muutmise ajamoment.';
COMMENT ON COLUMN riha.comment.infosystem_uuid IS 'InfoSystem uuid';
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE riha.comment TO riha;
......
......@@ -74,7 +74,7 @@ public class ApiGenericDAOImpl<T, K> implements ApiGenericDAO<T, K> {
return clazz.getSimpleName();
} else {
Table table = clazz.getAnnotation(Table.class);
return table.schema() + "." + table.name();
return (StringUtils.isBlank(table.schema()) ? "" : table.schema() + ".") + table.name();
}
}
......
package ee.eesti.riha.rest.dao.util;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
......@@ -94,6 +90,9 @@ public class SqlFilter {
} else {
throw new IllegalArgumentException("This operator (null_or_>) is meant for end_date");
}
} else if (fieldHolder.getType().equals(UUID.class)) {
filterExpr = itemPrefix + fc.getOperandLeft() + " = " + (":" + (opRight + i) + "\\:\\:uuid");
params.put(opRight + i, fc.getOperandRight());
} else {
// by default treat as string (also applies to date)
filterExpr = itemPrefix + fc.getOperandLeft() + " " + fc.getOperator() + " :" + (opRight + i);
......
......@@ -26,7 +26,7 @@ public final class JsonContentBasedTable {
jsonContentBasedTables.add(Main_resource.class);
jsonContentBasedTables.add(Document.class);
jsonContentBasedTables.add(Data_object.class);
jsonContentBasedTables.add(Comment.class);
// jsonContentBasedTables.add(Comment.class);
}
/**
......
package ee.eesti.riha.rest.model;
import java.util.Date;
import java.util.UUID;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -33,7 +34,7 @@ import ee.eesti.riha.rest.model.util.FieldIsPK;
@TypeDefs({@TypeDef(name = "JsonObject", typeClass = JsonObjectUserType.class) })
@Transactional
@Entity
@Table(name = "comment")
@Table(name = "comment", schema = "riha")
@JsonInclude(Include.NON_NULL)
public class Comment implements BaseModel {
......@@ -72,6 +73,7 @@ public class Comment implements BaseModel {
private String kind;
private UUID infosystem_uuid;
/*
* (non-Javadoc)
*
......@@ -401,4 +403,12 @@ public class Comment implements BaseModel {
kind = aKind;
}
public UUID getInfosystem_uuid() {
return infosystem_uuid;
}
@DisallowUseMethodForUpdate
public void setInfosystem_uuid(UUID infosystem_uuid) {
this.infosystem_uuid = infosystem_uuid;
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment