View Javadoc
1   /*
2    * Copyright (C) 2023 B3Partners B.V.
3    *
4    * SPDX-License-Identifier: MIT
5    */
6   package org.tailormap.api.persistence;
7   
8   import com.fasterxml.jackson.databind.JsonNode;
9   import jakarta.persistence.Column;
10  import jakarta.persistence.Entity;
11  import jakarta.persistence.EntityListeners;
12  import jakarta.persistence.Id;
13  import jakarta.persistence.Version;
14  import org.hibernate.annotations.Type;
15  import org.tailormap.api.persistence.listener.EntityEventPublisher;
16  
17  @Entity
18  @EntityListeners(EntityEventPublisher.class)
19  public class Configuration {
20    public static final String DEFAULT_APP = "default-app";
21  
22    public static final String DEFAULT_BASE_APP = "default-base-app";
23  
24    public static final String HOME_PAGE = "home-page";
25  
26    public static final String PORTAL_MENU = "portal-menu";
27  
28    @Id private String key;
29  
30    @Version private Long version;
31  
32    @Column(columnDefinition = "text")
33    private String value;
34  
35    @Type(value = io.hypersistence.utils.hibernate.type.json.JsonBinaryType.class)
36    @Column(columnDefinition = "jsonb")
37    private JsonNode jsonValue;
38  
39    private boolean availableForViewer;
40  
41    // <editor-fold desc="getters and setters">
42    public String getKey() {
43      return key;
44    }
45  
46    public void setKey(String key) {
47      this.key = key;
48    }
49  
50    public Long getVersion() {
51      return version;
52    }
53  
54    public Configuration setVersion(Long version) {
55      this.version = version;
56      return this;
57    }
58  
59    public String getValue() {
60      return value;
61    }
62  
63    public void setValue(String value) {
64      this.value = value;
65    }
66  
67    public JsonNode getJsonValue() {
68      return jsonValue;
69    }
70  
71    public void setJsonValue(JsonNode jsonValue) {
72      this.jsonValue = jsonValue;
73    }
74  
75    public boolean isAvailableForViewer() {
76      return availableForViewer;
77    }
78  
79    public void setAvailableForViewer(boolean availableForViewer) {
80      this.availableForViewer = availableForViewer;
81    }
82    // </editor-fold>
83  }