掲示板

What is classPK?

thumbnail
16年前 に Jay Sellers によって更新されました。

What is classPK?

New Member 投稿: 21 参加年月日: 08/04/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
16年前 に claudia wagner によって更新されました。

RE: What is classPK?

New Member 投稿: 5 参加年月日: 08/04/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
16年前 に Bruno Farache によって更新されました。

RE: What is classPK?

Liferay Master 投稿: 603 参加年月日: 07/05/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
16年前 に Jay Sellers によって更新されました。

RE: What is classPK?

New Member 投稿: 21 参加年月日: 08/04/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
16年前 に claudia wagner によって更新されました。

RE: What is classPK?

New Member 投稿: 5 参加年月日: 08/04/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...
9年前 に Marquita Priester によって更新されました。

RE: What is classPK?

New Member 投稿: 3 参加年月日: 14/09/05 最新の投稿
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
9年前 に David H Nebinger によって更新されました。

RE: What is classPK?

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
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
4年前 に Pankaj Rohilla によって更新されました。

RE: What is classPK?

New Member 投稿: 1 参加年月日: 18/02/21 最新の投稿
https://proliferay.com/concept-of-classpk-in-liferay/


​​​​​​​
Please refer this link, you will understand easily the concept of classpk in liferay.
thumbnail
4年前 に Santosh B Biradar によって更新されました。

RE: What is classPK?

Junior Member 投稿: 41 参加年月日: 15/08/04 最新の投稿
Hi,

In simple words className is nothing but entity name/Table name and classPk is nothing but Primary key of the entity.
4年前 に Ramalingaiah dudimetla によって更新されました。

RE: What is classPK?

New Member 投稿: 1 参加年月日: 19/07/29 最新の投稿
Hi All,

it is same UserId and ClassPK Id.
Regards
Ram