wood burning stoves*
The moose likes Object Relational Mapping and the fly likes how to use spaced column names in hibernate orderby mapping xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "how to use spaced column names in hibernate orderby mapping xml" Watch "how to use spaced column names in hibernate orderby mapping xml" New topic
Author

how to use spaced column names in hibernate orderby mapping xml

Krishnaa Kumar
Greenhorn

Joined: May 05, 2011
Posts: 25
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

Joined: Dec 23, 2008
Posts: 122
Hi Krishnaa ,

How are you initializing your map ?
Krishnaa Kumar
Greenhorn

Joined: May 05, 2011
Posts: 25
I couldn't get your question.

The map was initialized by hibernate.
Hemant Thard
Ranch Hand

Joined: Dec 23, 2008
Posts: 122
hi Krishnaa,

Hibernate doesn't initialize your map.
you have to initialize it yourself .. look into your bean class.
 
Don't get me started about those stupid light bulbs.
 
subject: how to use spaced column names in hibernate orderby mapping xml