integer « Validation « JPA Q&A

1. how to validate integers or Long values,so that it should accept only numbers not characters using annotations in Hibernate?

I have a Command Class as below

public class DistrictCommand {
private Integer districtId;
private String code;
private String name;
private String stateName;
private Long pincode;
} Here i want to validate the pincode,if i leave the pincode field ...