I've got the following class mapping a MySQL table:

```
@Entity
@Table(name = "category")
public class Category {

    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name = "id")
    private long id;

    @Column(name = "parent_id")
    private long parentId;

```

and I get the following error when dealing with columns that have NULL value of `parent_id` column:

`INFO: HHH000327: Error performing load command : org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.blogspot.symfonyworld.wealthylaughingduck.model.Category.parentId`

This is just a java error: NULL can't be assigned to `long` type (`private long parentId`). I couldn't find any hint how to overcome this problem and I can only think of replacing `long` with `Long`. Is it a good idea or maybe there is some built-in hibernate annotation or whatever mechanism to do this particular stuff?