Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Maximiliano Chiesa
Duplicate JournalArticle
September 10, 2012 10:30 AM

Maximiliano Chiesa

Rank: Junior Member

Posts: 47

Join Date: July 20, 2012

Recent Posts


I inserted a Journal Article using the Asset Publisher portlet. This JournalArticle has two different categories. The problem that I'm having is that when I retrieve all the JournalArticles from the database this JournalArticle that I inserted is duplicate (different ID, same title and content), so I don't know if when you insert a JournalArticle with two categories it inserts it inserts its two times (one time for each category).

Is this ok or I'm doing something wrong?

This is how I'm getting the Journals from the database:

DynamicQuery query = DynamicQueryFactoryUtil.forClass(JournalArticle.class,PortalClassLoaderUtil.getClassLoader());
List<JournalArticle> assetEntries = JournalArticleLocalServiceUtil.dynamicQuery(query);

Thanks in adavance!
Harish Kumar
RE: Duplicate JournalArticle
September 12, 2012 11:29 PM

Harish Kumar

Rank: Expert

Posts: 474

Join Date: July 31, 2010

Recent Posts

Hi Maximiliano

Only one record is created in DB no matter how many categories you are associating with a web content. May be your inserting it in duplicate.
you can assign multiple categories to a web content in one go.

multiple entries are added to assetentries_assetcategories table only to maintain the mapping.

For getting the journal articles you should use JournalArticleLocalServiceUtil class.


Participate in the State of Liferay Community 2017. Help the community and even win some prizes!