1
我有這樣的問題:我有一個屬性在類Test應該不映射到表的列(我使用它後,我的測試對象加載來確定應該將Test對象刪除或不刪除)。在我的情況下,這個屬性是布爾刪除:休眠,沒有綁定到表
@Entity
@Table(name = "[NewMVC].[dbo].[Tests]")
public class Test {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private int id;
@Column(name = "testQuestion")
private String testQuestion;
@Column(name = "optionOne")
private String optionOne;
@Column(name = "optionTwo")
private String optionTwo;
@Column(name = "optionThree")
private String optionThree;
@Column(name = "subjectType")
private int subjectType;
@Column(name = "correctOptionNumber")
private int correctOptionNumber;
private boolean delete = false;
....
我應該怎麼告訴休眠我的屬性刪除沒有映射到列?
乾杯!有用!謝謝! –