From 33b54619b644fbce2b224b0f8fbcff6ddd70bf74 Mon Sep 17 00:00:00 2001 From: Sean Flanigan Date: Sat, 21 Jan 2017 22:04:25 +1000 Subject: [PATCH] refactor: add workaround for huangp/entityunit#4 --- .../main/kotlin/org/zanata/model/HLocale.kt | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/server/zanata-model/src/main/kotlin/org/zanata/model/HLocale.kt b/server/zanata-model/src/main/kotlin/org/zanata/model/HLocale.kt index 6c5bb5902c..1e5296677c 100644 --- a/server/zanata-model/src/main/kotlin/org/zanata/model/HLocale.kt +++ b/server/zanata-model/src/main/kotlin/org/zanata/model/HLocale.kt @@ -49,9 +49,24 @@ class HLocale : ModelEntityBase, Serializable, HasUserFriendlyToString { @get:Type(type = "localeId") var localeId: LocaleId - var isActive: Boolean = false + // entityunit 0.3 assumes that each field has a property of the same name, + // so we define the "active" field to go with the "isActive" accessor + @JvmField + final var active: Boolean = false + var isActive: Boolean + get() = active + set(value) { + active = value + } + + @JvmField + final var enabledByDefault: Boolean = false + var isEnabledByDefault: Boolean + get() = enabledByDefault + set(value) { + enabledByDefault = value + } - var isEnabledByDefault: Boolean = false var supportedProjects: Set? = null @ManyToMany @JoinTable(name = "HProject_Locale", joinColumns = arrayOf(JoinColumn(name = "localeId")), inverseJoinColumns = arrayOf(JoinColumn(name = "projectId")))