Commit 7f03740e authored by Maxym Borodenko's avatar Maxym Borodenko Committed by Matija Obreza

Parent CooperatorOwnedLang for all *Lang classes

parent 62ec5c84
......@@ -28,32 +28,19 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
@Entity
@Table(name = "code_value_lang")
@JsonIdentityInfo(scope = CodeValueLang.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class CodeValueLang extends CooperatorOwnedModel {
public class CodeValueLang extends CooperatorOwnedLang<CodeValue> {
private static final long serialVersionUID = -8056778240683451739L;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "code_value_id", nullable = false)
private CodeValue codeValue;
@Basic
@Column
@Lob
private String description;
@Id
@JsonProperty
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "code_value_lang_id")
private Long id;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "sys_lang_id", nullable = false)
private SysLang sysLang;
@Basic
@Column(nullable = false, length = 500)
private String title;
public CodeValueLang() {
}
......@@ -69,14 +56,6 @@ public class CodeValueLang extends CooperatorOwnedModel {
this.codeValue = codeValue;
}
public String getDescription() {
return description;
}
public void setDescription(final String description) {
this.description = description;
}
public Long getId() {
return id;
}
......@@ -85,19 +64,4 @@ public class CodeValueLang extends CooperatorOwnedModel {
this.id = id;
}
public SysLang getSysLang() {
return sysLang;
}
public void setSysLang(final SysLang sysLang) {
this.sysLang = sysLang;
}
public String getTitle() {
return title;
}
public void setTitle(final String title) {
this.title = title;
}
}
\ No newline at end of file
......@@ -17,7 +17,10 @@ package org.gringlobal.model;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
/**
......@@ -26,7 +29,7 @@ import javax.persistence.MappedSuperclass;
* @author Maxym Borodenko
*/
@MappedSuperclass
public abstract class CooperatorLang extends CooperatorOwnedModel {
public abstract class CooperatorOwnedLang<T extends CooperatorOwnedModel> extends CooperatorOwnedModel {
private static final long serialVersionUID = -8074420732594755502L;
@Basic
......@@ -35,9 +38,13 @@ public abstract class CooperatorLang extends CooperatorOwnedModel {
protected String description;
@Basic
@Column(length = 500)
@Column(nullable = false, length = 500)
protected String title;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "sys_lang_id", nullable = false)
protected SysLang sysLang;
public String getDescription() {
return description;
}
......@@ -54,4 +61,12 @@ public abstract class CooperatorLang extends CooperatorOwnedModel {
this.title = title;
}
public SysLang getSysLang() {
return sysLang;
}
public void setSysLang(final SysLang sysLang) {
this.sysLang = sysLang;
}
}
......@@ -28,7 +28,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
@Entity
@Table(name = "crop_trait_code_lang")
@JsonIdentityInfo(scope = CropTraitCodeLang.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class CropTraitCodeLang extends CooperatorLang {
@AttributeOverride(name = "title", column = @Column(nullable = true, length = 500))
public class CropTraitCodeLang extends CooperatorOwnedLang<CropTraitCode> {
private static final long serialVersionUID = 8734983132443264074L;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
......@@ -41,10 +42,6 @@ public class CropTraitCodeLang extends CooperatorLang {
@Column(name = "crop_trait_code_lang_id")
private Long id;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "sys_lang_id", nullable = false)
private SysLang sysLang;
public CropTraitCodeLang() {
}
......@@ -68,11 +65,4 @@ public class CropTraitCodeLang extends CooperatorLang {
this.id = id;
}
public SysLang getSysLang() {
return sysLang;
}
public void setSysLang(final SysLang sysLang) {
this.sysLang = sysLang;
}
}
\ No newline at end of file
......@@ -28,7 +28,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
@Entity
@Table(name = "crop_trait_lang")
@JsonIdentityInfo(scope = CropTraitLang.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class CropTraitLang extends CooperatorLang {
@AttributeOverride(name = "title", column = @Column(nullable = true, length = 500))
public class CropTraitLang extends CooperatorOwnedLang<CropTrait> {
private static final long serialVersionUID = 1415634897733917322L;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
......@@ -41,10 +42,6 @@ public class CropTraitLang extends CooperatorLang {
@Column(name = "crop_trait_lang_id")
private Long id;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "sys_lang_id", nullable = false)
private SysLang sysLang;
public CropTraitLang() {
}
......@@ -68,12 +65,4 @@ public class CropTraitLang extends CooperatorLang {
this.id = id;
}
public SysLang getSysLang() {
return sysLang;
}
public void setSysLang(final SysLang sysLang) {
this.sysLang = sysLang;
}
}
\ No newline at end of file
......@@ -28,7 +28,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
@Entity
@Table(name = "source_descriptor_code_lang")
@JsonIdentityInfo(scope = SourceDescriptorCodeLang.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class SourceDescriptorCodeLang extends CooperatorLang {
@AttributeOverride(name = "title", column = @Column(nullable = true, length = 500))
public class SourceDescriptorCodeLang extends CooperatorOwnedLang<SourceDescriptorCode> {
private static final long serialVersionUID = -6651240212098239872L;
@Id
......@@ -41,10 +42,6 @@ public class SourceDescriptorCodeLang extends CooperatorLang {
@JoinColumn(name = "source_descriptor_code_id", nullable = false)
private SourceDescriptorCode sourceDescriptorCode;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "sys_lang_id", nullable = false)
private SysLang sysLang;
public SourceDescriptorCodeLang() {
}
......@@ -68,12 +65,4 @@ public class SourceDescriptorCodeLang extends CooperatorLang {
this.sourceDescriptorCode = sourceDescriptorCode;
}
public SysLang getSysLang() {
return sysLang;
}
public void setSysLang(final SysLang sysLang) {
this.sysLang = sysLang;
}
}
\ No newline at end of file
......@@ -28,7 +28,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
@Entity
@Table(name = "source_descriptor_lang")
@JsonIdentityInfo(scope = SourceDescriptorLang.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class SourceDescriptorLang extends CooperatorLang {
@AttributeOverride(name = "title", column = @Column(nullable = true, length = 500))
public class SourceDescriptorLang extends CooperatorOwnedLang<SourceDescriptor> {
private static final long serialVersionUID = 7116474808205086996L;
@Id
......@@ -41,10 +42,6 @@ public class SourceDescriptorLang extends CooperatorLang {
@JoinColumn(name = "source_descriptor_id", nullable = false)
private SourceDescriptor sourceDescriptor;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "sys_lang_id", nullable = false)
private SysLang sysLang;
public SourceDescriptorLang() {
}
......@@ -68,12 +65,4 @@ public class SourceDescriptorLang extends CooperatorLang {
this.sourceDescriptor = sourceDescriptor;
}
public SysLang getSysLang() {
return sysLang;
}
public void setSysLang(final SysLang sysLang) {
this.sysLang = sysLang;
}
}
\ No newline at end of file
......@@ -28,14 +28,9 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
@Entity
@Table(name = "sys_datatrigger_lang")
@JsonIdentityInfo(scope = SysDatatriggerLang.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class SysDatatriggerLang extends CooperatorOwnedModel {
public class SysDatatriggerLang extends CooperatorOwnedLang<SysDatatrigger> {
private static final long serialVersionUID = -4460748968617104284L;
@Basic
@Column
@Lob
private String description;
@Id
@JsonProperty
@GeneratedValue(strategy = GenerationType.IDENTITY)
......@@ -46,14 +41,6 @@ public class SysDatatriggerLang extends CooperatorOwnedModel {
@JoinColumn(name = "sys_datatrigger_id", nullable = false)
private SysDatatrigger sysDatatrigger;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "sys_lang_id", nullable = false)
private SysLang sysLang;
@Basic
@Column(nullable = false, length = 500)
private String title;
public SysDatatriggerLang() {
}
......@@ -61,14 +48,6 @@ public class SysDatatriggerLang extends CooperatorOwnedModel {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(final String description) {
this.description = description;
}
public Long getId() {
return id;
}
......@@ -84,20 +63,4 @@ public class SysDatatriggerLang extends CooperatorOwnedModel {
public void setSysDatatrigger(final SysDatatrigger sysDatatrigger) {
this.sysDatatrigger = sysDatatrigger;
}
public SysLang getSysLang() {
return sysLang;
}
public void setSysLang(final SysLang sysLang) {
this.sysLang = sysLang;
}
public String getTitle() {
return title;
}
public void setTitle(final String title) {
this.title = title;
}
}
\ No newline at end of file
......@@ -29,14 +29,9 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
@Cacheable
@Table(name = "sys_dataview_field_lang")
@JsonIdentityInfo(scope = SysDataviewFieldLang.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class SysDataviewFieldLang extends CooperatorOwnedModel {
public class SysDataviewFieldLang extends CooperatorOwnedLang<SysDataviewField> {
private static final long serialVersionUID = -6367401516327563260L;
@Basic
@Column
@Lob
private String description;
@Id
@JsonProperty
@GeneratedValue(strategy = GenerationType.IDENTITY)
......@@ -47,14 +42,6 @@ public class SysDataviewFieldLang extends CooperatorOwnedModel {
@JoinColumn(name = "sys_dataview_field_id", nullable = false)
private SysDataviewField sysDataviewField;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "sys_lang_id", nullable = false)
private SysLang sysLang;
@Basic
@Column(nullable = false, length = 500)
private String title;
public SysDataviewFieldLang() {
}
......@@ -62,14 +49,6 @@ public class SysDataviewFieldLang extends CooperatorOwnedModel {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(final String description) {
this.description = description;
}
public Long getId() {
return id;
}
......@@ -86,19 +65,4 @@ public class SysDataviewFieldLang extends CooperatorOwnedModel {
this.sysDataviewField = sysDataviewField;
}
public SysLang getSysLang() {
return sysLang;
}
public void setSysLang(final SysLang sysLang) {
this.sysLang = sysLang;
}
public String getTitle() {
return title;
}
public void setTitle(final String title) {
this.title = title;
}
}
\ No newline at end of file
......@@ -29,14 +29,9 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
@Cacheable
@Table(name = "sys_dataview_lang")
@JsonIdentityInfo(scope = SysDataviewLang.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class SysDataviewLang extends CooperatorOwnedModel {
public class SysDataviewLang extends CooperatorOwnedLang<SysDataview> {
private static final long serialVersionUID = -6532597361966857246L;
@Basic
@Column
@Lob
private String description;
@Id
@JsonProperty
@GeneratedValue(strategy = GenerationType.IDENTITY)
......@@ -47,14 +42,6 @@ public class SysDataviewLang extends CooperatorOwnedModel {
@JoinColumn(name = "sys_dataview_id", nullable = false)
private SysDataview dataview;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "sys_lang_id", nullable = false)
private SysLang sysLang;
@Basic
@Column(nullable = false, length = 500)
private String title;
public SysDataviewLang() {
}
......@@ -62,14 +49,6 @@ public class SysDataviewLang extends CooperatorOwnedModel {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(final String description) {
this.description = description;
}
public Long getId() {
return id;
}
......@@ -85,20 +64,4 @@ public class SysDataviewLang extends CooperatorOwnedModel {
public void setDataview(final SysDataview sysDataview) {
this.dataview = sysDataview;
}
public SysLang getSysLang() {
return sysLang;
}
public void setSysLang(final SysLang sysLang) {
this.sysLang = sysLang;
}
public String getTitle() {
return title;
}
public void setTitle(final String title) {
this.title = title;
}
}
\ No newline at end of file
......@@ -28,14 +28,9 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
@Entity
@Table(name = "sys_file_lang")
@JsonIdentityInfo(scope = SysFileLang.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class SysFileLang extends CooperatorOwnedModel {
public class SysFileLang extends CooperatorOwnedLang<SysFile> {
private static final long serialVersionUID = 7172737067204909917L;
@Basic
@Column
@Lob
private String description;
@Id
@JsonProperty
@GeneratedValue(strategy = GenerationType.IDENTITY)
......@@ -46,14 +41,6 @@ public class SysFileLang extends CooperatorOwnedModel {
@JoinColumn(name = "sys_file_id", nullable = false)
private SysFile sysFile;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "sys_lang_id", nullable = false)
private SysLang sysLang;
@Basic
@Column(nullable = false, length = 500)
private String title;
public SysFileLang() {
}
......@@ -61,14 +48,6 @@ public class SysFileLang extends CooperatorOwnedModel {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(final String description) {
this.description = description;
}
public Long getId() {
return id;
}
......@@ -84,20 +63,4 @@ public class SysFileLang extends CooperatorOwnedModel {
public void setSysFile(final SysFile sysFile) {
this.sysFile = sysFile;
}
public SysLang getSysLang() {
return sysLang;
}
public void setSysLang(final SysLang sysLang) {
this.sysLang = sysLang;
}
public String getTitle() {
return title;
}
public void setTitle(final String title) {
this.title = title;
}
}
\ No newline at end of file
......@@ -28,14 +28,9 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
@Entity
@Table(name = "sys_group_lang")
@JsonIdentityInfo(scope = SysGroupLang.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class SysGroupLang extends CooperatorOwnedModel {
public class SysGroupLang extends CooperatorOwnedLang<SysGroup> {
private static final long serialVersionUID = -7062292145715663004L;
@Basic
@Column
@Lob
private String description;
@Id
@JsonProperty
@GeneratedValue(strategy = GenerationType.IDENTITY)
......@@ -46,14 +41,6 @@ public class SysGroupLang extends CooperatorOwnedModel {
@JoinColumn(name = "sys_group_id", nullable = false)
private SysGroup sysGroup;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "sys_lang_id", nullable = false)
private SysLang sysLang;
@Basic
@Column(nullable = false, length = 500)
private String title;
public SysGroupLang() {
}
......@@ -61,14 +48,6 @@ public class SysGroupLang extends CooperatorOwnedModel {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(final String description) {
this.description = description;
}
public Long getId() {
return id;
}
......@@ -85,19 +64,4 @@ public class SysGroupLang extends CooperatorOwnedModel {
this.sysGroup = sysGroup;
}
public SysLang getSysLang() {
return sysLang;
}
public void setSysLang(final SysLang sysLang) {
this.sysLang = sysLang;
}
public String getTitle() {
return title;
}
public void setTitle(final String title) {
this.title = title;
}
}
\ No newline at end of file
......@@ -28,32 +28,19 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
@Entity
@Table(name = "sys_permission_lang")
@JsonIdentityInfo(scope = SysPermissionLang.class, generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class SysPermissionLang extends CooperatorOwnedModel {
public class SysPermissionLang extends CooperatorOwnedLang<SysPermission> {
private static final long serialVersionUID = 727395435818941738L;
@Basic
@Column
@Lob
private String description;
@Id
@JsonProperty
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "sys_permission_lang_id")
private Long id;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "sys_lang_id", nullable = false)
private SysLang sysLang;
@ManyToOne(fetch = FetchType.LAZY, cascade = {})
@JoinColumn(name = "sys_permission_id", nullable = false)
private SysPermission sysPermission;
@Basic
@Column(nullable = false, length = 500)
private String title;
public SysPermissionLang() {
}
......@@ -61,14 +48,6 @@ public class SysPermissionLang extends CooperatorOwnedModel {
this.id = id;
}
public String getDescription() {
return description;
}
public void setDescription(final String description) {
this.description = description;
}
public Long getId() {
return id;
}
......@@ -77,14 +56,6 @@ public class SysPermissionLang extends CooperatorOwnedModel {
this.id = id;
}
public SysLang getSysLang() {
return sysLang;