Planned maintenance is scheduled for the week of June 15th - the exact date and time will be announced soon.
See More Details
Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Service Builder - UUID as Primary Key?
Hi
How do you configure Service Builder to build the auto-generated UUID as the PK for the table?
Thanks
Jez
How do you configure Service Builder to build the auto-generated UUID as the PK for the table?
Thanks
Jez
um, you don't. UUIDs are supposed to be surrogate keys that you can give to the outside world to represent a unique record, but they should not be your primary keys.
When you say "you don't" is that because it is a limitation of Liferay (ie "you can't")? My data model uses UUIDs as Primary Keys and I would like to implement it using Service Builder.
Hi Jeremy,
beside what David wrote, a uuid, how the Liferay is using that for assets or pages for example, is not a real primary key on system level, because the groupId is needed also to have a unique key for one object. With other words, a uuid is unique only within one group.
The question is, for what would you like to your uuid? What is the meaning of your uuid?
Regards,
Zsigmond
beside what David wrote, a uuid, how the Liferay is using that for assets or pages for example, is not a real primary key on system level, because the groupId is needed also to have a unique key for one object. With other words, a uuid is unique only within one group.
The question is, for what would you like to your uuid? What is the meaning of your uuid?
Regards,
Zsigmond
Hi Zsigmond
I use UUIDs as IDs for entities (interfacing with flat XML/Document X.500/object stores). I can use utilities to create my own UUID as the PK for Service Builder entities, but it seemed a waste as Service Builder provides the UUID interface.
Regards
Jeremy
I use UUIDs as IDs for entities (interfacing with flat XML/Document X.500/object stores). I can use utilities to create my own UUID as the PK for Service Builder entities, but it seemed a waste as Service Builder provides the UUID interface.
Regards
Jeremy
Hi Jeremy,
as I can see your needs, unfortunately, you cannot use the Liferay's uuid mechanism. It's working in a bit different way.
Regards,
Zsigmond
as I can see your needs, unfortunately, you cannot use the Liferay's uuid mechanism. It's working in a bit different way.
Regards,
Zsigmond
Hi all,
may I use table id as PK instead of uuid?
I mean in 'dlfileentry' table, i.e., which is the primary key? fileEntryId? uuid_? Or the couple uuid_ & groupId?
may I use table id as PK instead of uuid?
I mean in 'dlfileentry' table, i.e., which is the primary key? fileEntryId? uuid_? Or the couple uuid_ & groupId?
Hi Giuseppe,
in case of DLFileEntry table, the fileEntryId is the primary key and the groupId and the uuid_ constitute a unique key on the table.
Regards,
Zsigmond
in case of DLFileEntry table, the fileEntryId is the primary key and the groupId and the uuid_ constitute a unique key on the table.
Regards,
Zsigmond
Community
Company
Feedback