Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Jay Sellers
What is classPK?
April 12, 2008 4:00 PM
Answer

Jay Sellers

Rank: New Member

Posts: 21

Join Date: April 12, 2008

Recent Posts

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.
claudia wagner
RE: What is classPK?
April 13, 2008 1:07 AM
Answer

claudia wagner

Rank: New Member

Posts: 6

Join Date: April 13, 2008

Recent Posts

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?
Bruno Farache
RE: What is classPK?
April 13, 2008 9:21 AM
Answer

Bruno Farache

LIFERAY STAFF

Rank: Liferay Master

Posts: 502

Join Date: May 14, 2007

Recent Posts

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".
Jay Sellers
RE: What is classPK?
April 13, 2008 12:35 PM
Answer

Jay Sellers

Rank: New Member

Posts: 21

Join Date: April 12, 2008

Recent Posts

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
claudia wagner
RE: What is classPK?
April 14, 2008 12:58 AM
Answer

claudia wagner

Rank: New Member

Posts: 6

Join Date: April 13, 2008

Recent Posts

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...