2012-06-07 48 views
0

財產比方說,我有以下類別:的javax驗證,驗證對象與註釋

public class MyProductCode { 
    private String code; 
    // getter and setter 
} 

public class MyProduct { 
    @NotNull 
    private MyProductCode myCode; 
    // getter and setter 
} 

是否有可能通過「myProduct的」類驗證「代碼」屬性? 事情是這樣的:

@NotNull(property = "code") 
private MyProductCode myCode; 

回答