Fórum

What is classPK?

thumbnail
Jay Sellers, modificado 16 Anos atrás.

What is classPK?

New Member Postagens: 21 Data de Entrada: 12/04/08 Postagens Recentes
I can't seem to find a solid definition of what "classPK" is, can someone answer this for me? I've searched the LifeRay forums and have found many references to it, but no definitions.

If it helps, I'm analyzing the relationships between the tables used by the Message Board portlet.
thumbnail
claudia wagner, modificado 16 Anos atrás.

RE: What is classPK?

New Member Postagens: 5 Data de Entrada: 13/04/08 Postagens Recentes
I also need a explanation of classPK, because I want to extend the page-rating and the page-commenting functionality.
Anyone here how knows about classPK?
thumbnail
Bruno Farache, modificado 16 Anos atrás.

RE: What is classPK?

Liferay Master Postagens: 603 Data de Entrada: 14/05/07 Postagens Recentes
You can comment about some certain types of entities, say for example, a blog entry with pk 23, then classNameId will refer to a classname_ table row that holds value "com.liferay...BlogsEntry" and classPK will be 23.

Claudia, I guess the class name you will use is "com.liferay.portal.model.Layout".
thumbnail
Jay Sellers, modificado 16 Anos atrás.

RE: What is classPK?

New Member Postagens: 21 Data de Entrada: 12/04/08 Postagens Recentes
Thanks Bruno! So the className is essentially a reference to a database table and the classPK is the primary key reference in that table.

So, for example, when looking at the Subscription table, if I see a record with a classNameId of 10063 and a classPK of 11010 then:
1. I go to the className table and look for the value related to classNameId of 10063.
2. Seeing that the value for 10063 is "com.liferay.portlet.messageboards.model.MBCategory", I know to next look at the MBCATEGORY liferay database table.
3. I now look for a record in here with a categoryId equal to my initial classPK in the subscription table (11010).

I understand whats going on here, thanks much for the clarification.

-Jay
thumbnail
claudia wagner, modificado 16 Anos atrás.

RE: What is classPK?

New Member Postagens: 5 Data de Entrada: 13/04/08 Postagens Recentes
Thanks Bruno! I also understand whats classPK.
classPK corresponds to the plid of each page in the layout table.
ok, so I will have to change the Page Comment Portlet so, that it will be possible to show more comment therads on one page...
Marquita Priester, modificado 9 Anos atrás.

RE: What is classPK?

New Member Postagens: 3 Data de Entrada: 05/09/14 Postagens Recentes
I know this question is old, but what is class name and classPk as relates to the sanitize function? I'm implementing the sanitize function.
thumbnail
David H Nebinger, modificado 9 Anos atrás.

RE: What is classPK?

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
It is still the same answer.

Class name is the name of an entity and class PK is the primary key value which represents a unique entity.

Conceptually it allows a Liferay table to refer to any entity using a loosely defined/weak reference. For example, the AssentEntry table/entity is for a Liferay asset (a unique value), but the asset refers to some other entity such as a blog entry, a message board post, a web content article, ... The class name defines the type of entity and the class PK is the primary key (so you can identify a unique blog entry, message board post, web content article), ...

For whatever sanitize function you're talking about, the concept of the class name and pk is still the same.
thumbnail
Pankaj Rohilla, modificado 4 Anos atrás.

RE: What is classPK?

New Member Mensagem: 1 Data de Entrada: 21/02/18 Postagens Recentes
https://proliferay.com/concept-of-classpk-in-liferay/


​​​​​​​
Please refer this link, you will understand easily the concept of classpk in liferay.
thumbnail
Santosh B Biradar, modificado 4 Anos atrás.

RE: What is classPK?

Junior Member Postagens: 41 Data de Entrada: 04/08/15 Postagens Recentes
Hi,

In simple words className is nothing but entity name/Table name and classPk is nothing but Primary key of the entity.
Ramalingaiah dudimetla, modificado 4 Anos atrás.

RE: What is classPK?

New Member Mensagem: 1 Data de Entrada: 29/07/19 Postagens Recentes
Hi All,

it is same UserId and ClassPK Id.
Regards
Ram