• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

how to use spaced column names in hibernate orderby mapping xml

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Krishnaa ,

How are you initializing your map ?
 
Krishnaa Kumar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Krishnaa,

Hibernate doesn't initialize your map.
you have to initialize it yourself .. look into your bean class.
 
Where all the women are strong, all the men are good looking and all the tiny ads are above average:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic