Currently im working in a project where we had recently a discussion about this. So lets have any database table with a numeric column which is allowed to have "no value" in the source code.
Some of my colleagues prefer to use the primitive type int in their mapped objects and set the value in this case to -1; i prefer to make this column nullable, using the Integer object in source instead of the primitive type and set this value to null.
Now im searching for the pro's and con's of both variants but couldn't find anything so far.
The only article i found so far is this one: http://www.javapractices.com/topic/TopicAction.do?Id=134 ...
There is a very common exception to this rule. For Model Objects, which map roughly to database records, it's often appropriate to use null to represent optional fields stored as NULL in the database
...
@EDIT I need to add that such kind of columns are used in this project as a kind of fake foreign keys. They are not real database constraints but used as such. Dont ask me why...i know i know :-) -1 in this case means it has no relationship to the primay key/id of another table. So its not needed for any calculations or such stuff...