if marginUpper can be null, you should use Integer instead of int
public class Margins { private int id; private Integer marginUpper; // Getter Setter NoArgConstructor AllArgsConstructor }