I need to query the components based on a particular schema and I tried to use both SchemaTitle as well as ItemSchema criteria for same but I am not getting any results. I have published DCPs and having entry of my schema in schema table and have an entry in Component and CP tables as well. Any help will be appreciated. I am using Tridion 2013 SP1 code snippet is below:
-
Your code looks correct. Are the components published to the correct CD target? Also, are they published from the publication you're querying, I.e. 55?– Nickoli RoussakovCommented Aug 22, 2014 at 12:48
-
Yes Nickoli, I checked the Broker DB as well as Storage config. If I am directly fetching a CP for a component with same schema then its getting fetched. But Criteria code is not working. While Querying , the Criterias are coming as null and hence its giving null results. There is no error coming.– user918Commented Aug 22, 2014 at 15:53
-
1At this point I would enable SQL logging with Hibernate and see what the DB query is being generated. Then I would run the DB query directly via SQL Manager and see what's in the query regarding schema where it includes the schema id/name (eliminate conditions in the WHERE clause until you find the culprit), and this should give you a hint on what's going wrong. Here is how to enable sql logging: tridion.stackexchange.com/a/3448/159– Nickoli RoussakovCommented Aug 22, 2014 at 22:13
-
It was a storage config issue. Thanks for help Nickoli.– user918Commented Aug 24, 2014 at 12:12
-
Can you share the details of what was wrong in your config as an Answer to this question so that we can close the case?– Nickoli RoussakovCommented Aug 25, 2014 at 20:15
|
Show 1 more comment