Here are the examples of the java api @play.data.validation.Constraints.Required taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3 Examples
19
Source : JOrderItem.java
with MIT License
from vangav
with MIT License
from vangav
@Enreplacedy
public clreplaced JOrderItem extends Model {
private static final long serialVersionUID = 1L;
@Id
public Long id;
@ManyToOne
public JOrder order;
@Required
@Min(1)
public Integer qty;
@Required
@Pattern(value = "[A-Z]{4}-[0-9]{3,}", message = "A valid product code is required")
public String productCode;
@DateTime(pattern = "yyyy-MM-dd")
public Date deliveryDate;
}
19
Source : JOrder.java
with MIT License
from vangav
with MIT License
from vangav
@Enreplacedy
public clreplaced JOrder extends Model {
private static final long serialVersionUID = 1L;
@Id
public Long id;
@ManyToOne
public JCustomer customer;
@Required
@DateTime(pattern = "yyyy-MM-dd")
public Date date;
@OneToMany
@Valid
public List<JOrderItem> items;
}
19
Source : JCustomer.java
with MIT License
from vangav
with MIT License
from vangav
@Enreplacedy
public clreplaced JCustomer extends Model {
private static final long serialVersionUID = 1L;
@Id
public Long id;
@Email
@Required
public String email;
@OneToMany
@Valid
public List<JOrder> orders;
}