java - hibernate saving enum and retrieve values? -


i have enum below.

public enum testenum { example, further_example, last_example } 

with mapping in .hbm:

<property name="testenum" column="test_column">     <type name="org.hibernate.type.enumtype">         <param name="enumclass">p.a.c.k.testenum</param>     </type>  </property> 

the enum sent database 0, 1, 2. fine. when retrieve same results need example, further_example, last_example instead of 0,1,2. how can that? please me!

based on answer in reply of comment.

you want access enum value enum ordinal. if so, can use below code.

testenum value = testenum.values()[ordinal] //ordinal can position talking about. 

if not want, forget answer, if looking for, +1 it.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

ios - iPhone/iPad different view orientations in different views , and apple approval process -

Shrink a YouTube video to responsive width -