sockeqwe/sqlbrite-dao

Add Mappable Object to ContentValues conversion method

Closed this issue · 1 comments

A feature request:
If I create a Mappable Object MyObject then MyObjectMapper.contentValues support populating the content values from individual fields. It would be highly useful to have a myObject(MyObject myObject) method that will copy all fields from Mappable Object to Content Values. Then I could do:

MyObjectMapper.contentValues().myObject(myObject).build(); // better
MyObjectMapper.contentValues()  // sometimes this is painful!
          .field1(myObject.field1)
          .field2(myObject.field2)
          .field3(myObject.field3)
          .build();

yep it's on my todo list see #2. I think about something like this: MyObjectMapper.contentValues(myObject).build()

What do you think?
Please continue the discussion in #2 since it's duplicated