I'm mapping a table to a class that uses primitives in the getter/setter methods, e.g. public long getQuantity() and public void setQuantity(long). The class doesn't use fields in the traditional sense, e.g. there's no private long quantity. Instead the class is backed by another storage mechanism (think of it like a hashmap that accepts primitives). Changing the database or changing the class are not valid options. The semantics of the class is such that the absence of a key in the 'hashmap' means the value is null. Is it possible to instruct Hibernate to skip processing of these attributes if the database column is null? In other words, if the column QUANTITY is null do not call setQuantity(long)? If not, is there another approach that will achive the same result?
Thanks,
-Kaare
|