Enlightensoft's Blog

Helping in your each step

  • Categories

  • Authors

composite-id map in Hibernate

Posted by Pankil Patel on March 18, 2010

<composite-id mapped=”true”>
<key-property name=”medicineId” column=”medicine_id” type=”long”/>
<key-property name=”symptomsId” column=”symptoms_id” type=”long”/>
</composite-id>

SELECT * FROM medicine m where m.medicine_id in (
select ms.medicine_id from medicine_symptoms ms where ms.symptoms_id in (1, 5, 7) group by ms.medicine_id )

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: