Hi Brian,
Yes GORM. The reverse engineering for Grails is a little simpler because all that is needed are Domain classes and the framework handles all the hibernate mappings. So for example a DB table called Application would only need a single Domain class instead of a Domain, DAO and XML Mapping file. Here is an example with one-to-many and many-to-one relationships
class Application {
BigDecimal gpa
Date submitDate
String appliedFlag
String acceptedFlag
String deniedFlag
String managerNetid
Date timeStamp
AcademicYear academicYear
Quarter quarter
Student student
Set<ApplicationFile> applicationFiles = []
Set<ApplicationQa> applicationQas = []
Set<ApplicationAccepted> applicationAccepteds = []
Set<ApplicationDenied> applicationDenieds = []
static hasMany = [applicationAccepteds: ApplicationAccepted,
applicationDenieds: ApplicationDenied,
applicationFiles: ApplicationFile,
applicationQas: ApplicationQa]
static belongsTo = [AcademicYear, Quarter, Student]
static mapping = {
version false
quarter column: "quarter_code"
student column: "sid"
applicationAccepteds cascade: "save-update, delete-orphan"
applicationDenieds cascade: "save-update, delete-orphan"
applicationQas cascade: "save-update"
}
static constraints = {
submitDate nullable: true
appliedFlag maxSize: 1
acceptedFlag maxSize: 1
deniedFlag maxSize: 1
managerNetid nullable: true, maxSize: 36
}
}
There used to be a plugin for Grails that had this functionality and uses the hibernate-tools library but it stopped being maintained a while ago and the newer Grail releases are not compatible. I figured since MyEclipse uses the same hibernate-tools to generate Java code that maybe it would be possible to expand on that to generate Grails domain classes?
http://grails-plugins.github.io/grails-db-reverse-engineer/grails3v4/index.html