フォーラム

ホーム » Liferay Portal » English » 3. Development

構造的に表示 平面上に表示 ツリー上に表示
スレッド [ 前へ | 次へ ]
toggle
Christian Schulze
Finding AssetCategories with DynamicQuery?
2011/12/07 8:50
答え

Christian Schulze

ランク: Junior Member

投稿: 87

参加年月日: 2009/11/19

最近の投稿

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?
2011/12/07 12:28
答え

Jelmer Kuperus

ランク: Liferay Legend

投稿: 1192

参加年月日: 2010/03/10

最近の投稿

Use

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


instead of

1DynamicQueryFactoryUtil.forClass(AssetCategory.class)
Vishal Panchal
RE: Finding AssetCategories with DynamicQuery?
2013/02/25 10:43
答え

Vishal Panchal

ランク: Expert

投稿: 279

参加年月日: 2012/05/20

最近の投稿

Hey Jelmer,

Thank you..!


Regards,
Vishal