Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Christian Schulze
Finding AssetCategories with DynamicQuery?
7 dicembre 2011 8.50
Risposta

Christian Schulze

Punteggio: Junior Member

Messaggi: 87

Data di Iscrizione: 19 novembre 2009

Messaggi recenti

Hello, how can I find all AssetCategory for an AssetVocabulary with a DynamicQuery.

I try this:

 1
 2               DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(AssetCategory.class).add(
 3                PropertyFactoryUtil.forName("vocabularyId").eq(navigationVocabulary.getVocabularyId()));
 4
 5        try {
 6            List query = AssetCategoryLocalServiceUtil.dynamicQuery(dynamicQuery);
 7            System.out.println(query.size());
 8        }
 9        catch (SystemException e) {
10            // TODO Auto-generated catch block
11            e.printStackTrace();
12        }


and get this:

 116:45:51,819 INFO  [PluginPackageUtil:1274] Finished checking for available updates in 1 ms
 216:46:06,906 ERROR [DynamicQueryFactoryImpl:83] Unable find model com.liferay.portlet.asset.model.impl.AssetCategoryImpl
 3java.lang.ClassNotFoundException: com.liferay.portlet.asset.model.impl.AssetCategoryImpl
 4    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
 5    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
 6    at com.liferay.portal.dao.orm.hibernate.DynamicQueryFactoryImpl.getImplClass(DynamicQueryFactoryImpl.java:78)
 7    at com.liferay.portal.dao.orm.hibernate.DynamicQueryFactoryImpl.getImplClass(DynamicQueryFactoryImpl.java:59)
 8    at com.liferay.portal.dao.orm.hibernate.DynamicQueryFactoryImpl.forClass(DynamicQueryFactoryImpl.java:33)
 9    at com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil.forClass(DynamicQueryFactoryUtil.java:23)


But why??

regards Chris
Jelmer Kuperus
RE: Finding AssetCategories with DynamicQuery?
7 dicembre 2011 12.28
Risposta

Jelmer Kuperus

Punteggio: Liferay Legend

Messaggi: 1192

Data di Iscrizione: 10 marzo 2010

Messaggi recenti

Use

1DynamicQueryFactoryUtil.forClass(AssetCategory.class, PortalClassLoaderUtil.getClassLoader())


instead of

1DynamicQueryFactoryUtil.forClass(AssetCategory.class)
Vishal Panchal
RE: Finding AssetCategories with DynamicQuery?
25 febbraio 2013 10.43
Risposta

Vishal Panchal

Punteggio: Expert

Messaggi: 280

Data di Iscrizione: 20 maggio 2012

Messaggi recenti

Hey Jelmer,

Thank you..!


Regards,
Vishal