Pro |
|
Joined: Fri Nov 19, 2004 5:52 pm Posts: 232 Location: Chicago, IL
|
I've noticed in some of the example code that reference types are used instead of primitives. For example, for an auto-increment id value like the following.
private Integer id;
public Integer getId() {
return id;
}
instead of,
private int id;
public int getId() {
return id;
}
I'm wondering if there are any advantages/disadvantages to using reference types instead of primitive types? I'm guessing that the main advantage is that you can easily distinguish whether the property has a null value in the database.
I'm wondering if I should just use reference types for everything? Does anyone have any recommendations?
|
|