I am creating this join from one table to another 
with the followin query: 


select sale.storeName 
from sale sale, storelocation sc 
where sale.store_id = sc.store_id 
and sale.storeLocId = sc.storeLocId 



<many-to-one name="sale" class="com.dao.hibernate.sale" not-null="true"> 
 
 
</many-to-one>  



in my store mapping i have the following: 


       <composite-id> 
           <key-property name="store_id" column="store_id" type="integer" /> 
           <key-property name="storeLocId" column="storeLocId" type="string"/>  
      
       </composite-id> 



I am creating this join from one table to another 
with the followin query: 


select sale.storeName 
from sale sale, storelocation sc 
where sale.store_id = sc.store_id 
and sale.storeLocId = sc.storeLocId 


<many-to-one name="sale" class="com.dao.hibernate.sale" not-null="true"> 
 
 
</many-to-one> 





org.hibernate.ObjectNotFoundException: No row with the given identifier exists: 
[EMAIL PROTECTED] 
org.hibernate.ObjectNotFoundException.throwIfNull(ObjectNotFoundException.java:27)
 
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:128)
 
org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:161)
 
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
 
org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:889) 
org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:857) 
org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266) 
org.hibernate.type.EntityType.resolve(EntityType.java:303) 
org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:113) 
org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842) 
org.hibernate.loader.Loader.doQuery(Loader.java:717) 
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
 
org.hibernate.loader.Loader.doList(Loader.java:2150) 
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029) 
org.hibernate.loader.Loader.list(Loader.java:2024) 
org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94) 
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1550) 
org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:298) 
org.hibernate.impl.CriteriaImpl$Subcriteria.list(CriteriaImpl.java:143)

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4029383#4029383

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4029383
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to