Ali Baba package types using programming specification --POJO

1, a

POJO class attribute is not the initial value. When the user need to be explicitly assign themselves, any NPE (NullPointerException, null pointer exception) problems, or check storage, by the user to be guaranteed.


2, illustrate

positive examples:
(1) the default type for all use of sql are null, if you write POJO mapping attribute type as the basic type, when the recording can not find the time to return null assigned to the basic types be wrong;

(2) the type of packaging can be appropriate transformed into basic types, if you set the basic types such as int, then it defaults initialized to 0, but 0 in itself represents a kind of meaning, if null then, both good understanding, can also be easier for developers to convert! And many xml configuration default is null.

Guess you like

Origin www.cnblogs.com/zwq20134/p/11578278.html