Reputation: 13655
I read on couple of articles that while using ORMLite, our objects must have Id property. One of the article is here:
However, I created a class without Id property and tried serializing and deserializing it and ORMLite did it without any problems. So what feature exactly necessitates the Id property?
Upvotes: 0
Views: 651
Reputation: 143399
The are several API's in OrmLite which rely on a primary key which will be either:
[PrimaryKey]
attributeId
Some of OrmLite API's that rely on a primary key is:
db.Update(entity)
- updates all fields except the primary key which is used as a filterdb.Delete(entity)
- uses the primary key as a filterdb.SingleById(id)
- uses the primary key as a filter Upvotes: 1