On Wed, Oct 7, 2009 at 12:55 PM, harryh <[email protected]> wrote: > > I have a long field in my database that I want to have a unique index > (enforced by the database). Sometimes this field will be empty, in > which case I'd like to set it to NULL. 0 won't work because that > won't work with the unique index. > > MappedLong appears to be converting null to 0 internally. > Additionally overriding defaultValue for the field and returning null > does not appear to work. > > Is this by design?
Yes. > Is it possible that I am misunderstanding something > here? > I think you're looking for a MappedOptLong which will treat None (or Empty) as NULL and Some(Long) as the value. Please open a ticket and I'll add the code. > > -harryh > > > > -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
