Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you invoke a database function call from grails?

How do you invoke database functions from grails? Such as the CONVERT(decimal, timestamp) Without using groovy SQL like this:

def sql = new Sql(dataSource)

I would like to avoid any SQL statements and take full advantage of the grails magic.

like image 211
PJT Avatar asked Feb 18 '26 05:02

PJT


1 Answers

My understanding is that grails does not have native support for database functions. You will need to write SQL. Gorm is an abstraction of Hibernate, you may want to refer to:

How can you call custom database functions with Hibernate?

like image 161
chrislovecnm Avatar answered Feb 20 '26 18:02

chrislovecnm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!