I am using a Flex client with BlazeDS remoting. The entity on the client side has a corresponding DTO object and the Long id translates to a Number class on the Flex side. Unfortunately Adobe designed the Number class in such a way that it cannot be null. Yes, a single class out of thousands of ActionScript classes that cannot be null!!!
When a new entity rematerializes on the server side the id is 0 instead of null. My entity is defined simply:
Code:
@Id
@Column(name="ID")
@GeneratedValue
protected Long id;
Is there any way to ask hibernate to interpret
null and
0 as the same thing - unsaved entity?
Thanks.