Hello
I am creating a version control domain class:
I would like to add a query to the largest version number stored:
. In SQL this query would look more or less as follows:
The function MUST return the value as a long.
What is the correct way to do this in grails?
Thanks
I am creating a version control domain class:
Code:
class VersionControl {
Date dateCreated
Long versionNumber
Long getLatestVersionNumber() {
//return largest versionNumber
}
}
I would like to add a query to the largest version number stored:
Code:
Long getLatestVersionNumber()
Code:
SELECT TOP 1 MAX(versionNumber) FROM VersionControl
The function MUST return the value as a long.
What is the correct way to do this in grails?
Thanks