lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gopalbisht <bisht_gopal2...@rediffmail.com>
Subject I am unable to create index of an object having composite key
Date Fri, 24 Apr 2009 07:49:38 GMT

Hi all,

I am using hibernate search with lucene. I need to create index of DomainTag
object  which have only one composite key. I am unware  how to define the
annotations for the composite key in DomainTag (pojo) class.
If any one can help , please help me. Thanks  in advance.

My DomainTag.hbm.xml file is as follows:
--------------------------------------****************************----------------------------
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
    
<hibernate-mapping>
<!-- 
    Created by the Middlegen Hibernate plugin 2.2

    http://boss.bekk.no/boss/middlegen/
    http://www.hibernate.org/
-->

<class 
    name="com.test.manager.DomainTag" 
    table="domaintag" 
    >

    <composite-id>
	    <!-- Associations -->
	    <!-- derived association(s) for compound key -->
	    <!-- bi-directional many-to-one association to Item -->
	 <!-- Associations -->
	    <!-- derived association(s) for compound key -->
	    <!-- bi-directional many-to-one association to Item -->
	    <key-many-to-one
	        name="topic"
		    class="com.test.manager.DomainTest">
	    	<column name="domain_id" />
		</key-many-to-one>
		
	    <!-- bi-directional many-to-one association to Tag -->
	    <key-many-to-one
	        name="tag"
		    class="com.test.manager.Tag">
	    	<column name="tag_id" />
		</key-many-to-one>

	</composite-id>      

</class>
</hibernate-mapping>
--------------------------------------****************************----------------------------
-- 
View this message in context: http://www.nabble.com/I-am-unable-to-create-index-of-an-object-having-composite-key-tp23211575p23211575.html
Sent from the Lucene - Java Developer mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message