Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

java - Hibernate query filter on collection -


i want execute following query:

from item i.categoryitems.catalogid = :catid 

that yields in following exception: illegal attempt dereference collection googled, found hibernate forum post https://forum.hibernate.org/viewtopic.php?p=2349920 recommended me following:

from item i, in (i.categoryitems) i.catalogid = :catid 

this kind of works, there's problem this: returns me object array item object , categoryitem object. i'm interested in single item object (list)

my mapping of 'item':

<hibernate-mapping package="be.xx.xx.xx.xx.domain" default-access="field">   <class name="item" table="item">       <id name="articleid" column="article_id" type="long">         <generator class="assigned" />     </id> ... ...         <set name="categoryitems" table="category_item">             <key column="item_id" />             <one-to-many class="be.xx.xx.xx.xx.domain.categoryitem" />     </set> </class> </hibernate-mapping> 

anybody got ideas?

thanks

try:

select item inner join i.categoryitems cat cat.id = :catid 

explanation: navigation have tried: i.categoryitems.catalogid works 1:1 or n:1 relations, not 1:n. -- 1:n have use explicite join operation.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -