The Leap Day!!

Nothing much today~~
Just feel like posting something in this leap day
Oh, there was an article on people who are celebrating their birthday today on Today newspaper.
But I guess the editor and the writer both can’t do maths.
The person mentioned is 28 years old today, but the title was saying that he is “turning nine”.
Haha..
Suddenly I [...]

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Iyem Sariyem

Iyem Sariyem Binti Sukaryem
Anak petani bayem
Hobinya dari tanem-menanem
Sampai beradem-ayem
Di bawah pohon palem
Iyem Sariyem Binti Sukaryem
Tidurnya ga bisa merem
Kalo barusan nonton filem
Yang berhantu dan serem-serem
Pas tengah malem
Iyem Sariyem Binti Sukaryem
Mulutnya ga bisa mingkem
Kalo dikasih makan asem
“Mendingan makan garem”
Begitu kata si Iyem
Tapi jangan macem-macem
Sama Iyem Sariyem
Nyawa bisa terancem
Secara kukunya tajem
Meskipun item-item
__________________________________
//dalam rangka ga ada kerjaan
//dedicated to [...]

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS

Hibernate: Ordering with SQL function

If you need to do ordering by an SQL function, eg:
ORDER BY YOUR_SQL_FUNCTION(your_table.your_column) ASC
This is what you need to do so that you can use Hibernate for this kind of ordering:
1. In your Hibernate mapping xml, add the following:
<class
name=”…”
table=”…”
>

<subselect>
<![CDATA[SELECT your_table.*, YOUR_SQL_FUNCTION(your_table.your_column) AS temp_column_name FROM YOUR_TABLE your_table]]>
</subselect>
<property
name=”javaFieldName”
type=”java.lang.String”
column=”temp_column_name”
update=”false”
insert=”false”
>
</property>
</class>
2. In your persistent Java class, add getter and setter [...]

Tags:

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS