留言板

What is classPK?

thumbnail
Jay Sellers,修改在16 年前。

What is classPK?

New Member 帖子: 21 加入日期: 08-4-12 最近的帖子
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,修改在16 年前。

RE: What is classPK?

New Member 帖子: 5 加入日期: 08-4-13 最近的帖子
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,修改在16 年前。

RE: What is classPK?

Liferay Master 帖子: 603 加入日期: 07-5-14 最近的帖子
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,修改在16 年前。

RE: What is classPK?

New Member 帖子: 21 加入日期: 08-4-12 最近的帖子
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,修改在16 年前。

RE: What is classPK?

New Member 帖子: 5 加入日期: 08-4-13 最近的帖子
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,修改在9 年前。

RE: What is classPK?

New Member 帖子: 3 加入日期: 14-9-5 最近的帖子
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,修改在9 年前。

RE: What is classPK?

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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,修改在4 年前。

RE: What is classPK?

New Member 发布: 1 加入日期: 18-2-21 最近的帖子
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,修改在4 年前。

RE: What is classPK?

Junior Member 帖子: 41 加入日期: 15-8-4 最近的帖子
Hi,

In simple words className is nothing but entity name/Table name and classPk is nothing but Primary key of the entity.
Ramalingaiah dudimetla,修改在4 年前。

RE: What is classPK?

New Member 发布: 1 加入日期: 19-7-29 最近的帖子
Hi All,

it is same UserId and ClassPK Id.
Regards
Ram