yahoo / squidb

SquiDB is a SQLite database library for Android and iOS
https://github.com/yahoo/squidb/wiki
Apache License 2.0
1.31k stars 132 forks source link

How to ignore a property in model #246

Closed arashcoder closed 7 years ago

arashcoder commented 7 years ago

Hi. There is a @Ignore annotation, but when i use it, I cannot access that property. So is there a way to tell squidb to ignore a property and not save it as a field in database? thank you.

sbosley commented 7 years ago

Sorry, I'm not sure I fully understand what you're asking. Properties are just a representation of columns in a table, so the idea of a column that isn't saved to the database doesn't really apply. Are you just looking to attach unpersisted metadata to a model object? If so, you can use the "transitory" methods present on all model objects; these methods let you attach arbitrary in-memory objects to any model instance using a key. See putTransitory() and getTransitory().

Does that answer your question or were you looking for something else?

arashcoder commented 7 years ago

Thanks for the reply. I think this is what I'm looking for.