title: Spring boot handle null values of Database
body: <p>I am using SPring provided JPA dependency to list all items from User table. Some users doest have phone numbers in database and i am getting below error. Any way to ignore null values of DB?</p>
  
  <pre><code>java.lang.IllegalArgumentException: Can not set long field com.freelancer.Entity.User.phone to null value
      at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) ~[na:1.8.0_161]
      at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) ~[na:1.8.0_161]
      at sun.reflect.UnsafeLongFieldAccessorImpl.set(UnsafeLongFieldAccessorImpl.java:80) ~[na:1.8.0_161]
      at java.lang.reflect.Field.set(Field.java:764) ~[na:1.8.0_161]
      at org.hibernate.property.access.spi.SetterFieldImpl.set(SetterFieldImpl.java:41) ~[hibernate-core-5.2.16.Final.jar:5.2.16.Final]
  </code></pre>
  
  <p>Entity class is like below:</p>
  
  <pre><code>@Table(name = "user")
  @EntityListeners(AuditingEntityListener.class)
  @JsonIgnoreProperties(value = {"createdAt"},
          allowGetters = true)
  public class User implements Serializable {
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      private int id;
  
      @NotBlank
      private String name;
  
      @NotBlank
      private String email;
  
      @NotBlank
      private String password;
  
  
      private long phone;
      private String about;
      private int profile_id;
      private String skills;
  </code></pre>