API 1.0.50 AppText Translations
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package com.aitrainer.api.model
|
||||
|
||||
import com.google.gson.annotations.Expose
|
||||
import org.hibernate.annotations.Fetch
|
||||
import org.hibernate.annotations.FetchMode
|
||||
import org.springframework.lang.NonNull
|
||||
import javax.persistence.*
|
||||
|
||||
@Entity
|
||||
data class AppText (
|
||||
@Expose @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @get: NonNull var textId: Long = 0,
|
||||
@Expose @get: NonNull var textKey: String,
|
||||
@Expose @get: NonNull var screenshotUrl: String,
|
||||
@Expose @get: NonNull var checked: Boolean? = null,
|
||||
) {
|
||||
@OneToMany(cascade = [(CascadeType.ALL)], fetch = FetchType.EAGER, mappedBy = "appText")
|
||||
@Fetch(value = FetchMode.SUBSELECT)
|
||||
@Expose val translations: List<AppTextTranslation> = mutableListOf<AppTextTranslation>().toList()
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.aitrainer.api.model
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore
|
||||
import com.google.gson.annotations.Expose
|
||||
import org.springframework.lang.NonNull
|
||||
import javax.persistence.*
|
||||
import javax.validation.constraints.NotBlank
|
||||
|
||||
@Entity
|
||||
data class AppTextTranslation (
|
||||
@Expose @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @get: NonNull var translationId: Long = 0,
|
||||
@Expose @get: NotBlank var languageCode: String? = "hu",
|
||||
@Expose @get: NonNull var text: String? = null
|
||||
) {
|
||||
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||
@JoinColumn(name = "textId", nullable = false)
|
||||
@JsonIgnore val appText: AppText? = null
|
||||
}
|
||||
Reference in New Issue
Block a user