ORMLite multiple Primary Keys and attach database (SQLite)

406 views
Skip to first unread message

Václav Souhrada

unread,
Jun 19, 2013, 9:41:02 AM6/19/13
to ormlit...@googlegroups.com
Hello, 

I have a question about multiple primary keys / id fields in ORMLite. 

Our database structure is very complicated and we now evaluate some ORM frameworks. We started with ORMLite and we have a problem with multiple pk. Is there workaround for this? e.g. We have db structure

Operator 1 -> N OperatorPeripheralsAccess and OperatorPeripheralsAccess has primary key which contains from 3 columns. But this is not possible in ORMLite right now? Next my question is if ORMLite support attaching of databases for SQLite? Thank you for your reply.

Best Regards,
Vaclav Souhrada

Gray Watson

unread,
Jun 22, 2013, 10:56:55 AM6/22/13
to ormlit...@googlegroups.com
On Jun 19, 2013, at 9:41 AM, Václav Souhrada <v.sou...@gmail.com> wrote:

> Our database structure is very complicated and we now evaluate some ORM frameworks. We started with ORMLite and we have a problem with multiple pk.
>
> Is there workaround for this?

Right now ORMLite does not support multiple primary keys. About the only work around is to have a single generated primary key and then have a unique restraint on the multiple fields in question.

> Next my question is if ORMLite support attaching of databases for SQLite?

I don't think I know what that means. Hrm, just found it on the google. So you can certain execute the raw SQL commands to do the attach but ORMLite doesn't support it otherwise.

gray

Reply all
Reply to author
Forward
0 new messages