I am using Seam,Hibernate and Mysql. In the case of not null string(ie. Empty("")) , it is being inserted in database. , I know Oracle replaces "" with null, but mysql doesn't function that way. So what to do to avoid this?
Paul Sturrock wrote:You'll need to fix your application logic to correct this behaviour. If you do not want empty strings to be persisted don't set properties in your objects to be empty strings.
In my hibernate entity I have tried to set @NotEmpty, but was giving me problem. Is there any other way where I need to let hibernate entity know about this?
At the application level, I have fixed by setting null. But wondering, can I do diretctly at the hibernate entity level.