How to set UUID for primary id in JStORM ?

1 view
Skip to first unread message

浩翔

unread,
Mar 19, 2009, 2:26:32 AM3/19/09
to JStORM-users
Hi guys,

How to set UUID for primary id in JStORM ?
Do you have any example ?
Thank you !
Alex

urielka

unread,
Mar 19, 2009, 6:25:52 AM3/19/09
to JStORM-users
There is no way to do it,but you can add a String field and store the
UUID as a secondary key and index it.
anyway UUID as primary key is a bad design(in most cases) and is
slower to do lookups in almost all databases(if not all).
if you want you can implement your own UUID field,just look in the
source code of http://labs.urielkatz.com/browser/JStORM/trunk/src/JStORM.Field.js
Reply all
Reply to author
Forward
0 new messages