-->
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.  [ 5 posts ] 
Author Message
 Post subject: how to create multi-column index with hibernate 3?
PostPosted: Wed Apr 23, 2008 3:28 am 
Newbie

Joined: Mon Dec 24, 2007 6:21 am
Posts: 8
hi,

I am doing a application that needs multi-clumn index.

I explain the thing:

I have user and group tables as well as objects.

In the user Object, userid is the primary key..

In the group Object, i want to make userid and groupid as index.

I made index named as "grp_usr_id" in the sqlserver db (groups table)

I did like this:

<class name="com.meru.gmt.bo.groups.GroupsBean" table="usergroup">

<id name="groupId" type="java.lang.String" column="groupid" index="grp_usr_id">
<generator class="increment"/>
</id>

<property name="groupName" index="grp_usr_id">
<column name="groupName" />
</property>



<many-to-one name="users" insert="false" update="false" class="com.meru.gmt.bo.users.UsersBean" not-null="true" lazy="false" >
<column name ="userid"/>
</many-to-one>

</class>



but i got the mapping error on server displayed as:

ERROR [XMLHelper] Error parsing XML: XML InputStream(6) Attribute "index" must be declared for element type "id".


help me...


Thanks in advance..



Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 6:05 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
not related to tooling...

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: RE:how to create multi-colum index in hibernate 3?
PostPosted: Wed Apr 23, 2008 6:26 am 
Newbie

Joined: Mon Dec 24, 2007 6:21 am
Posts: 8
>>Problems with Session and transaction handling?

>>Read this: http://hibernate.org/42.html

Mistakenly added to the above lines.


apologize..

could you help me to solve the problem as i mentioned previous post?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 6:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
your question is still not related to tooling.

The error clearly states you have a syntax error in your xml file.

Ask in the user forum please. thanks.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 6:44 am 
Newbie

Joined: Mon Dec 24, 2007 6:21 am
Posts: 8
ok max...sorry for the disturbance..


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.