Commit 95c5e6c0 authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch '120-descriptor-publisher' into 'master'

Resolve "Descriptor publisher"

Closes #120

See merge request !115
parents a4ce9e21 0346ec91
......@@ -139,6 +139,10 @@ public class Descriptor extends UuidModel implements Publishable, Copyable<Descr
@Column(name = "keyDescriptor")
private boolean key;
/** The publisher. */
@Column(length = 200)
private String publisher;
/** Not published by default. */
private boolean published = false;
......@@ -515,6 +519,24 @@ public class Descriptor extends UuidModel implements Publishable, Copyable<Descr
this.key = key;
}
/**
* Sets the publisher.
*
* @param publisher the new publisher
*/
public void setPublisher(String publisher) {
this.publisher = publisher;
}
/**
* Gets the publisher.
*
* @return the publisher
*/
public String getPublisher() {
return publisher;
}
/**
* Checks if is published.
*
......
......@@ -60,8 +60,11 @@ public class DescriptorFilter extends AuditedVersionedModelFilter {
/** The uom. */
public Set<String> uom;
/** The key. */
public Boolean key;
/** The key. */
public Boolean key;
/** The publisher. */
public Set<String> publisher;
/** The published. */
public Boolean published;
......@@ -90,9 +93,12 @@ public class DescriptorFilter extends AuditedVersionedModelFilter {
if ((category != null) && !category.isEmpty()) {
and.and(descriptor.category.in(category));
}
if (key != null) {
and.and(descriptor.key.eq(key));
}
if (key != null) {
and.and(descriptor.key.eq(key));
}
if ((publisher != null) && !publisher.isEmpty()) {
and.and(descriptor.publisher.in(publisher));
}
if (published != null) {
and.and(descriptor.published.eq(published));
}
......
......@@ -52,6 +52,9 @@ public class DescriptorListFilter extends AuditedVersionedModelFilter {
/** The published. */
public Boolean published;
/** The publisher. */
public Set<String> publisher;
/**
* Builds the query.
*
......@@ -67,6 +70,9 @@ public class DescriptorListFilter extends AuditedVersionedModelFilter {
if (published != null) {
and.and(descriptorList.published.eq(published));
}
if ((publisher != null) && !publisher.isEmpty()) {
and.and(descriptorList.publisher.in(publisher));
}
if (title != null) {
and.and(title.buildQuery(descriptorList.title));
}
......
......@@ -3160,3 +3160,21 @@ databaseChangeLog:
onUpdate: NO ACTION
referencedColumnNames: id
referencedTableName: partner
- changeSet:
id: 1516643805000-2
author: mobreza
comment: Adding Descriptor.publisher
changes:
- addColumn:
columns:
- column:
name: publisher
type: VARCHAR(200)
tableName: descriptor
- createIndex:
columns:
- column:
name: publisher
indexName: FK_1d4veryraxx6fll3y8cnte24p
tableName: descriptor
Supports Markdown
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