This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use spaced column names in hibernate orderby mapping xml

 
Krishnaa Kumar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.,

I have a column name say USER IMAGE NAME. How to use this spaced column name in orderby attribute, to get sorted in descending order.

<map name="images" table="`USER IMAGE`" order-by="`USER IMAGE NAME` desc">
<key column="`USER ID`"/>
<index column="`USER IMAGE NAME`" type="string"/>
<element type="string" column="`USER IMAGE PATH`"/>
</map>
The code -- order-by="USER IMAGE NAME desc" not works.
 
Hemant Thard
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Krishnaa ,

How are you initializing your map ?
 
Krishnaa Kumar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I couldn't get your question.

The map was initialized by hibernate.
 
Hemant Thard
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Krishnaa,

Hibernate doesn't initialize your map.
you have to initialize it yourself .. look into your bean class.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic