• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JdbcTmplate.update and POJO data type

 
FY Hsieh
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I saw some spring jdbc code like




if I have

class Member {
private String name;
private String address;
private int zip;
private int age;
...
}

question --- Using this approach, what if I want to pass null value to zip ?
Does that mean I HAVE to use

private Integer zip;

instead ??

is it true we usually should use wrapper class instead of int, double, etc data type in the POJO so that we can handle passing NULL value ?

 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes

Mark

I love short answers. ;)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic