Service Builder - UUID as Primary Key?

Jeremy Place, modificat fa 12 anys. New Member Apunts: 11 Data d'incorporació: 29/03/13 Publicacions recents
Hi

How do you configure Service Builder to build the auto-generated UUID as the PK for the table?

Thanks

Jez
thumbnail
David H Nebinger, modificat fa 12 anys. Liferay Legend Apunts: 14933 Data d'incorporació: 02/09/06 Publicacions recents
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.
Jeremy Place, modificat fa 12 anys. New Member Apunts: 11 Data d'incorporació: 29/03/13 Publicacions recents
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.
thumbnail
Zsigmond Rab, modificat fa 12 anys. Liferay Master Apunts: 764 Data d'incorporació: 05/01/10 Publicacions recents
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
Jeremy Place, modificat fa 12 anys. New Member Apunts: 11 Data d'incorporació: 29/03/13 Publicacions recents
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
thumbnail
Zsigmond Rab, modificat fa 12 anys. Liferay Master Apunts: 764 Data d'incorporació: 05/01/10 Publicacions recents
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
Giuseppe Pantaleo, modificat fa 12 anys. New Member Apunts: 15 Data d'incorporació: 18/06/12 Publicacions recents
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?
thumbnail
Zsigmond Rab, modificat fa 12 anys. Liferay Master Apunts: 764 Data d'incorporació: 05/01/10 Publicacions recents
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