Save or update in Groovy -
usually in java execute select statement , check size of resultset. if 0 issue insert , otherwise update.
since groovy provides syntactic sugar on top of jdbc, i'm wondering if provides way ease process? there easier way save or update record?
note: know hibernate offers this, i'd rather stick groovy api.
there's lightweight orm called gstorm here i've had on list of things investigate has no dependencies, doesn't handle related domain objects
and library leverage grails gorm here (which pulls gorm out of grails has quite few dependencies including hibernate)
other (and other examples i've missed), there's nothing know of you're trying do. guess you'd have write own (you switch between insert or update depending on whether pass primary key -- assuming primary keys auto-generated db)
Comments
Post a Comment