这是我的pojo注释为实体
@Entity
@Table(name = "book", catalog = "book_db")
public class Book {
private Integer bookId;
private String bookName;
private String bookShortDesc;
private String bookDesc;
private String bookAuthor;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "book_id", unique = true, nullable = false)
public Integer getBookId() {
return this.bookId;
}
@Column(name = "book_name", nullable = false, length = 256)
public String getBookName() {
return this.bookName;
}
@Column(name = "book_short_desc", nullable = false, length = 1024)
public String getBookShortDesc() {
return this.bookShortDesc;
} …Run Code Online (Sandbox Code Playgroud) 我想知道是否有任何方法可以将一个键用作 .properties 文件中另一个键的值。
例如,这是可能的,还是有其他方法可以实现类似的目标?
key = another_key
app.name=Stack Over Flow
app.title.welcome=Welcome to {app.name}
Run Code Online (Sandbox Code Playgroud)
所以当我得到app.title.welcome它的价值应该是“ Welcome to Stack Over Flow”