Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

"Left join Fetch" "With Clause" Required

 
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Product and ProductBasic has one-to-one relationship
Product ---> ProductID <<PK>>
ProductBasic ----> ProductId, useCode, StartTime as composite key.....
this startTime's value will be known as runtime.

Now i want to define mapping between Product & ProductBasic, how will i do it ?



Moreover suppose i define their mapping as product.productID = productBasic.productID and useCode='a' as :

Product.hbm.xml:
<one-to-one name="productBasic" class="ProductBasic" cascade="save-update" property-ref="activeProduct" lazy="proxy" constrained="true">
<formula>'008'</formula>
<formula>PRODUCTID</formula>
</one-to-one>


ProductBasic.hbm.xml as :
<properties name="activeProduct">
<property name="useCode" column="USECODE"></property>
<many-to-one name="productBO" class="ProductBO" column="PRODUCTID" insert="false" update="false"/>
</properties>

How can i specify startTime value at runtime (say in eager fetching)? I can't use "inner join fetch" along "with clause".. ?

Or i want to specify a condition in fetch join that startTime<currentTime><endtime. the value of currenttime will be known
at runtime...How to make this work?>
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic