Re: [Lift] Re: Potential breaking change: MappedField.name, affects Mapper <> JSON
On 18/02/10 6:26 PM, harryh wrote: If this does happen please take care to include this information in the release notes for M3 (or whatever milestone first has this change) as people using json serialization for caching purposes will need to invalidate their caches. Putting the note in BIG CAPITAL LETTERS might be a good idea. Indeed! Note to Jeppe/Chas/IRC we need to add this in the release notes email that goes to lift-announce and liftweb. - Indrajit -harryh On Feb 18, 6:22 am, Jeppe Nejsum Madsen wrote: Hi, As part of fixinghttps://www.assembla.com/spaces/liftweb/tickets/155-lift-mapper-%28re... , I would like to change the semantics of MappedField.name slightly: Currently, the name is always lowercased, ie: class SampleModel extends KeyedMapper[Long, SampleModel] { object id extends MappedLongIndex(this) object firstName extends MappedString(this, 32) object moose extends MappedNullableLong(this) object notNull extends MappedString(this, 32) } firstName.name == "firstname"&& notNull.name == "notnull"&& id.name=="id" I would like to have name preserve the case of the field such that: firstName.name == "firstName"&& notNull.name == "notNull"&& id.name=="id" Reasons: 1) More consistent. css styles, default column headers etc based on name now follows the actual field name 2) Easier to implement #155 :-) name is used when serializing a Mapped object as JSON. So the JSON representation will be changed (unless we lowercase the name only when creating JSON, but this goes against 1) Now: { "$persisted":true, "id":1, "firstname":"Elwood", "moose":null, "notnull":"" } After proposed change: { "$persisted":true, "id":1, "firstName":"Elwood", "moose":null, "notNull":"" } I would like to get a feel for the pain this will cause people /Jeppe -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: Potential breaking change: MappedField.name, affects Mapper <> JSON
If this does happen please take care to include this information in the release notes for M3 (or whatever milestone first has this change) as people using json serialization for caching purposes will need to invalidate their caches. Putting the note in BIG CAPITAL LETTERS might be a good idea. -harryh On Feb 18, 6:22 am, Jeppe Nejsum Madsen wrote: > Hi, > > As part of > fixinghttps://www.assembla.com/spaces/liftweb/tickets/155-lift-mapper-%28re... > , I would like to change the semantics of MappedField.name slightly: > > Currently, the name is always lowercased, ie: > > class SampleModel extends KeyedMapper[Long, SampleModel] { > object id extends MappedLongIndex(this) > object firstName extends MappedString(this, 32) > object moose extends MappedNullableLong(this) > object notNull extends MappedString(this, 32) > > } > > firstName.name == "firstname" && notNull.name == "notnull" && id.name=="id" > > I would like to have name preserve the case of the field such that: > > firstName.name == "firstName" && notNull.name == "notNull" && id.name=="id" > > Reasons: > > 1) More consistent. css styles, default column headers etc based on name now > follows the actual > field name > 2) Easier to implement #155 :-) > > name is used when serializing a Mapped object as JSON. So the JSON > representation will be changed (unless we lowercase the name only when > creating JSON, but this goes against 1) > > Now: > { > "$persisted":true, > "id":1, > "firstname":"Elwood", > "moose":null, > "notnull":"" > > } > > After proposed change: > { > "$persisted":true, > "id":1, > "firstName":"Elwood", > "moose":null, > "notNull":"" > > } > > I would like to get a feel for the pain this will cause people > > /Jeppe -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.