Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GreenDAO creating an automatic ID property

is there a way to make the DB create the ID property in an automatic way?

I want to generate something that looks like this:

Entity entity = schema.addEntity("MyEntity");
entity.addIdProperty().autoIncrement().primaryKey();

is this possible?

like image 389
thepoosh Avatar asked Oct 30 '12 10:10

thepoosh


1 Answers

Yes, that looks just fine. Depending on your needs entity.addIdProperty() or entity.addIdProperty().autoIncrement() should be fine. addIdProperty will already call primaryKey().

like image 196
Markus Junginger Avatar answered Oct 21 '22 21:10

Markus Junginger