-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: many-to-one association with in component mapping
PostPosted: Tue Dec 23, 2008 5:09 pm 
Newbie

Joined: Wed Nov 09, 2005 3:55 pm
Posts: 7
Hi,
I'm using component within a hibernate object as follows.
I wanted to have a many-to-one association (<many-to-one name="housingProvision" > )within the component. In the following code, hibernate complaints that the Foo table should have IRDJobHousingProvisionID column. (please see the sql I have attached)

I want the association within the component , not on the hibernate object that has the component.
Please let me know if it could be done.



Hibernate version:

Mapping documents:
<hibernate-mapping package="com.ird.model">
<joined-subclass name="Foo" table="Foo"
extends="com.common.model.Party">
<key column="FooId"/>

<!-- Foo doesn't have a IRDJobHousingProvisionID -->


<component name="defaultHousing" class="com.ird.model.ICDHousing">
<property name="housingRestricted"/>
<property name="housingAddress"/>
<property name="housingInformation" column="housingDesc"/>
<property name="estimatedCost" column="housingEstimatedCost"/>
<property name="additionalCost" column="housingAdditionalCost"/>
<property name="features" column="housingFeatures"/>
<many-to-one name="housingProvision" class="com.ird.model.ref.IRDJobHousingProvision" cascade="none">
<column name="IRDJobHousingProvisionID" />
</many-to-one>
</component>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
23 Dec 2008 11:40:09,863 WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 207, SQLState: 42S22
23 Dec 2008 11:40:09,863 ERROR org.hibernate.util.JDBCExceptionReporter - Invalid column name 'IRDJobHousingProvisionID'.
23 Dec 2008 11:40:09,863 WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 207, SQLState: 42S22
23 Dec 2008 11:40:09,863 ERROR org.hibernate.util.JDBCExceptionReporter - Invalid column name 'IRDJobHousingProvisionID'.
23 Dec 2008 11:40:10,379 ERROR com.common.util.ExceptionProcessor - Exception being handled in Exception Processor for user: 525142 [nkrishnanandam@ird.com]
org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:613)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.support.HibernateDaoSupport.convertHibernateAccessException(HibernateDaoSupport.java:187)
at com.common.dao.impl.PagedCriteriaSupportImpl.search(PagedCriteriaSupportImpl.java:237)
at com.common.dao.impl.BaseSearchDAO.search(BaseSearchDAO.java:39)
at com.icd.dao.impl.FooDAOImpl.search(FooDAOImpl.java:29)
at com.icd.service.impl.FooManagerImpl.searchICDHostCompanies(FooManagerImpl.java:126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:301)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
at $Proxy448.searchICDHostCompanies(Unknown Source)
at com.icd.web.action.FooSearchAction.search(FooSearchAction.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.apache.struts2.interceptor.MessageStoreInterceptor.intercept(MessageStoreInterceptor.java:195)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at com.common.web.ResponsePrepareInterceptor.intercept(ResponsePrepareInterceptor.java:30)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.common.web.IntraxPDFFilter.doFilter(IntraxPDFFilter.java:41)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119)
at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2223)

Name and version of the database you are using:
SQL 2002

The generated SQL (show_sql=true):
select top 20 this_.FooId as PartyId101_2_, this_1_.version as version101_2_, this_1_.Name as Name101_2_, this_1_.FirstName as FirstName101_2_, this_1_.PhoneCountryCode as PhoneCou5_101_2_, this_1_.Phone as Phone101_2_, this_1_.PhoneExt as PhoneExt101_2_, this_1_.phoneCityCode as phoneCit8_101_2_, this_1_.phoneOnlyNumeric as phoneOnl9_101_2_, this_1_.MobilePhone as MobileP10_101_2_, this_1_.mobilePhoneCountryCode as mobileP11_101_2_, this_1_.mobilePhoneCityCode as mobileP12_101_2_, this_1_.faxCityCode as faxCity13_101_2_, this_1_.Fax as Fax101_2_, this_1_.email as email101_2_, this_1_.MiddleName as MiddleName101_2_, this_1_.GenderCode as GenderCode101_2_, this_1_.WhenBorn as WhenBorn101_2_, this_1_.isActive as isActive101_2_, this_1_.nickname as nickname101_2_, this_1_.whenCreated as whenCre21_101_2_, this_1_.createdById as created22_101_2_, this_1_.whenModified as whenMod23_101_2_, this_1_.modifiedById as modifie24_101_2_, this_.isSuspect as isSuspect186_2_, this_.DUNSNumber as DUNSNumber186_2_, this_.EIN as EIN186_2_, this_.website as website186_2_, this_.workCompInsureNum as workComp6_186_2_, this_.validateDate as validate7_186_2_, this_.hasICT as hasICT186_2_, this_.hasIWT as hasIWT186_2_, this_.hasIIP as hasIIP186_2_, this_.availableSpring as availab11_186_2_, this_.availableSummer as availab12_186_2_, this_.availableWinter as availab13_186_2_, this_.areaDescription as areaDes14_186_2_, this_.areaClimate as areaCli15_186_2_, this_.areaAltitude as areaAlt16_186_2_, this_.areaNearestMajorCities as areaNea17_186_2_, this_.areaThingsToDoDesc as areaThi18_186_2_, this_.areaWhatToWear as areaWha19_186_2_, this_.areaInfoWebsite as areaInf20_186_2_, this_.nearestSocialSecurityDesc as nearest21_186_2_, this_.typeOfBusinessShortDescription as typeOfB22_186_2_, this_.CompanyDesc as Company23_186_2_, this_.partnerPremiumPartnerid as partner24_186_2_, this_.partnerPremiumDate as partner25_186_2_, this_.icdRegionId as icdRegi26_186_2_, this_.icdProductId as icdProd27_186_2_, this_.CompanyAttractionsDesc as Company28_186_2_, this_.BusStationDesc as BusStat29_186_2_, this_.NearestAirportText as Nearest30_186_2_, this_.AirportDirectionsDesc as Airport31_186_2_, this_.NearestSocialSecurityOffice as Nearest32_186_2_, this_.nearestTrainStationDesc as nearest33_186_2_, this_.TravelInstructions as TravelI34_186_2_, this_.nearestInternationalAirportId as nearest35_186_2_, this_.ParentCompanyId as ParentC36_186_2_, this_.FooStatusId as ICDHost37_186_2_, this_.PlacementDirectorId as Placeme38_186_2_, this_.FooBrandScoreID as ICDHost39_186_2_, this_.legacyId as legacyId186_2_, this_.drugScreeningPolicyDesc as drugScr41_186_2_, this_.dressCodePolicyDesc as dressCo42_186_2_, this_.groomingCodePolicyDesc as groomin43_186_2_, this_.isTemporary as isTempo44_186_2_, this_.housingRestricted as housing45_186_2_, this_.housingAddress as housing46_186_2_, this_.housingDesc as housing47_186_2_, this_.housingEstimatedCost as housing48_186_2_, this_.housingAdditionalCost as housing49_186_2_, this_.housingFeatures as housing50_186_2_, this_.IRDJobHousingProvisionID as ICDJobH51_186_2_, icdproduct2_.ICDProductId as ICDProdu1_225_0_, icdproduct2_.name as name225_0_, icdproduct2_.ref as ref225_0_, icdproduct2_.isActive as isActive225_0_, icdproduct2_.seq as seq225_0_, parentcomp1_.FooId as PartyId101_1_, parentcomp1_1_.version as version101_1_, parentcomp1_1_.Name as Name101_1_, parentcomp1_1_.FirstName as FirstName101_1_, parentcomp1_1_.PhoneCountryCode as PhoneCou5_101_1_, parentcomp1_1_.Phone as Phone101_1_, parentcomp1_1_.PhoneExt as PhoneExt101_1_, parentcomp1_1_.phoneCityCode as phoneCit8_101_1_, parentcomp1_1_.phoneOnlyNumeric as phoneOnl9_101_1_, parentcomp1_1_.MobilePhone as MobileP10_101_1_, parentcomp1_1_.mobilePhoneCountryCode as mobileP11_101_1_, parentcomp1_1_.mobilePhoneCityCode as mobileP12_101_1_, parentcomp1_1_.faxCityCode as faxCity13_101_1_, parentcomp1_1_.Fax as Fax101_1_, parentcomp1_1_.email as email101_1_, parentcomp1_1_.MiddleName as MiddleName101_1_, parentcomp1_1_.GenderCode as GenderCode101_1_, parentcomp1_1_.WhenBorn as WhenBorn101_1_, parentcomp1_1_.isActive as isActive101_1_, parentcomp1_1_.nickname as nickname101_1_, parentcomp1_1_.whenCreated as whenCre21_101_1_, parentcomp1_1_.createdById as created22_101_1_, parentcomp1_1_.whenModified as whenMod23_101_1_, parentcomp1_1_.modifiedById as modifie24_101_1_, parentcomp1_.isSuspect as isSuspect186_1_, parentcomp1_.DUNSNumber as DUNSNumber186_1_, parentcomp1_.EIN as EIN186_1_, parentcomp1_.website as website186_1_, parentcomp1_.workCompInsureNum as workComp6_186_1_, parentcomp1_.validateDate as validate7_186_1_, parentcomp1_.hasICT as hasICT186_1_, parentcomp1_.hasIWT as hasIWT186_1_, parentcomp1_.hasIIP as hasIIP186_1_, parentcomp1_.availableSpring as availab11_186_1_, parentcomp1_.availableSummer as availab12_186_1_, parentcomp1_.availableWinter as availab13_186_1_, parentcomp1_.areaDescription as areaDes14_186_1_, parentcomp1_.areaClimate as areaCli15_186_1_, parentcomp1_.areaAltitude as areaAlt16_186_1_, parentcomp1_.areaNearestMajorCities as areaNea17_186_1_, parentcomp1_.areaThingsToDoDesc as areaThi18_186_1_, parentcomp1_.areaWhatToWear as areaWha19_186_1_, parentcomp1_.areaInfoWebsite as areaInf20_186_1_, parentcomp1_.nearestSocialSecurityDesc as nearest21_186_1_, parentcomp1_.typeOfBusinessShortDescription as typeOfB22_186_1_, parentcomp1_.CompanyDesc as Company23_186_1_, parentcomp1_.partnerPremiumPartnerid as partner24_186_1_, parentcomp1_.partnerPremiumDate as partner25_186_1_, parentcomp1_.icdRegionId as icdRegi26_186_1_, parentcomp1_.icdProductId as icdProd27_186_1_, parentcomp1_.CompanyAttractionsDesc as Company28_186_1_, parentcomp1_.BusStationDesc as BusStat29_186_1_, parentcomp1_.NearestAirportText as Nearest30_186_1_, parentcomp1_.AirportDirectionsDesc as Airport31_186_1_, parentcomp1_.NearestSocialSecurityOffice as Nearest32_186_1_, parentcomp1_.nearestTrainStationDesc as nearest33_186_1_, parentcomp1_.TravelInstructions as TravelI34_186_1_, parentcomp1_.nearestInternationalAirportId as nearest35_186_1_, parentcomp1_.ParentCompanyId as ParentC36_186_1_, parentcomp1_.FooStatusId as ICDHost37_186_1_, parentcomp1_.PlacementDirectorId as Placeme38_186_1_, parentcomp1_.FooBrandScoreID as ICDHost39_186_1_, parentcomp1_.legacyId as legacyId186_1_, parentcomp1_.drugScreeningPolicyDesc as drugScr41_186_1_, parentcomp1_.dressCodePolicyDesc as dressCo42_186_1_, parentcomp1_.groomingCodePolicyDesc as groomin43_186_1_, parentcomp1_.isTemporary as isTempo44_186_1_, parentcomp1_.housingRestricted as housing45_186_1_, parentcomp1_.housingAddress as housing46_186_1_, parentcomp1_.housingDesc as housing47_186_1_, parentcomp1_.housingEstimatedCost as housing48_186_1_, parentcomp1_.housingAdditionalCost as housing49_186_1_, parentcomp1_.housingFeatures as housing50_186_1_, parentcomp1_.IRDJobHousingProvisionID as ICDJobH51_186_1_ from Foo this_ inner join Party this_1_ on this_.FooId=this_1_.PartyId left outer join ICDProduct icdproduct2_ on this_.icdProductId=icdproduct2_.ICDProductId left outer join Foo parentcomp1_ on this_.ParentCompanyId=parentcomp1_.FooId left outer join Party parentcomp1_1_ on parentcomp1_.FooId=parentcomp1_1_.PartyId where ( this_1_.isDeleted = 0) and this_.hasIWT='true' and icdproduct2_.ICDProductId=1 and this_.isTemporary='false' order by this_.FooId desc

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 24, 2008 11:23 am 
Beginner
Beginner

Joined: Wed Apr 18, 2007 6:17 pm
Posts: 49
Location: Dominican Republic
Hello Anandkris, hibernate it's right about that. You need to have a foreign key the com.ird.model.ref.IRDJobHousingProvision table in the com.ird.model.Foo table so it can load the entity just as if you where using a many-to-one relationship outside of the component. The time you add the "IRDJobHousingProvisionID" column you will get what you want,


regards,


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.