| margaretha | 0866a53 | 2019-01-22 17:52:40 +0100 | [diff] [blame] | 1 | package de.ids_mannheim.korap.entity; |
| 2 | |
| margaretha | 6e79684 | 2023-08-17 15:10:45 +0200 | [diff] [blame] | 3 | import jakarta.persistence.Entity; |
| 4 | import jakarta.persistence.Id; |
| 5 | import jakarta.persistence.Table; |
| margaretha | 0866a53 | 2019-01-22 17:52:40 +0100 | [diff] [blame] | 6 | |
| 7 | /** |
| 8 | * Describes default_setting table. Each user may define one set of |
| 9 | * default settings. The elements of default settings are |
| 10 | * not strictly defined and thus are described as JSON strings. |
| 11 | * |
| 12 | * Some elements that are often used may be adopted as columns. |
| 13 | * |
| 14 | * Examples of the default settings' elements are foundry, layer and |
| 15 | * number of results per page. |
| 16 | * |
| 17 | * @author margaretha |
| 18 | * |
| 19 | */ |
| 20 | @Entity |
| 21 | @Table(name = "default_setting") |
| 22 | public class DefaultSetting { |
| 23 | |
| 24 | @Id |
| 25 | private String username; |
| 26 | private String settings; // json string |
| 27 | |
| 28 | public DefaultSetting () {} |
| 29 | |
| 30 | public DefaultSetting (String username, String settings) { |
| 31 | this.username = username; |
| 32 | this.settings = settings; |
| 33 | } |
| 34 | |
| 35 | @Override |
| 36 | public String toString () { |
| 37 | return "name= " + getUsername() + ", settings= " + getSettings(); |
| 38 | } |
| 39 | |
| 40 | public String getUsername () { |
| 41 | return username; |
| 42 | } |
| 43 | |
| 44 | public void setUsername (String username) { |
| 45 | this.username = username; |
| 46 | } |
| 47 | |
| 48 | public String getSettings () { |
| 49 | return settings; |
| 50 | } |
| 51 | |
| 52 | public void setSettings (String settings) { |
| 53 | this.settings = settings; |
| 54 | } |
| 55 | |
| 56 | } |