Hello!
I have implemented internationalization according to this link
But I just can’t connect entities with the Translation entity.
Here is my realization:
Translation Entity
@Entity
@Data
@Table(name = "translations")
public class Translation {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
// ID
private Long translationId;
@Column
private String locale;
@Lob
@Column(name = "messagekey", length = 3000)
private String key;
@Lob
@Column(name = "messagecontent", length = 100000)
private String content;
public Translation() {}
}
Post Entity
@Entity
@Data
@Table(name = "posts")
public class Post {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long postId;
private String postTitle; //must be l10n & should be in the table translations (messagecontent)
@Lob
@Column( length = 1500 )
private String postExcerpt; //must be l10n & should be in the table translations (messagecontent)
@Lob
@Column( length = 100000 )
private String postContent; //must be l10n & should be in the table translations (messagecontent)
private String postSlug;
private String postSeoTitle; //must be l10n & should be in the table translations (messagecontent)
@Lob
@Column( length = 1000 )
private String postSeoDescr; //must be l10n & should be in the table translations (messagecontent)
@Column(nullable = false, updatable = false)
private LocalDateTime creationDate;
public Post(){}
}
What would be the best solution? How can I solve the problem without creating other additional tables? Thanks in advance!