hibernate - Missing Column Id -
i reverse engineered database domain classes. when try run app, error
missing colum :
tbl_fiscal_year_idintblaccessright.
the definition , mappings domain classes follows
class tblaccessright { long rightid character code string name boolean active tblfiscalyear tblfiscalyear static hasmany = [tblprivileges: tblprivilege, tblresourcetypes: tblresourcetype] static mapping = { id column: "rightid", generator: "assigned",name:'rightid' version false table 'tblaccessright' } static constraints = { code maxsize: 1 name nullable: true, maxsize: 64 } } class tblfiscalyear { string fiscalyear string title boolean active character defaultfy static hasmany = [tblaccessrights: tblaccessright, tblappropriationgroups: tblappropriationgroup, tblbudgetprojectnames: tblbudgetprojectname, tblc3ipocs: tblc3ipoc, tblcises: tblcis, tblcommentses: tblcomments, tblcontractors: tblcontractor, tblcotrs: tblcotr, tbldasds: tbldasd, tbldirectors: tbldirector, tblkeys: tblkey, tblmiprpocs: tblmiprpoc, tblobjectiveses: tblobjectives, tblop32s: tblop32, tblorcs: tblorc, tblpeprojects: tblpeproject, tblprogramelements: tblprogramelement, tblprograms: tblprogram, tblresourcetypes: tblresourcetype, tblresources: tblresource, tblroles: tblrole, tbltrackchangeses: tbltrackchanges, tbltransactionses: tbltransactions] static mapping = { id name: "fiscalyear", generator: "assigned" ,type:'string', column:'fiscalyear' version false table 'tblfiscalyear' } static constraints = { fiscalyear maxsize: 4 title nullable: true, maxsize: 48 defaultfy nullable: true, maxsize: 1 } }
you have modify mappings in tblaccessright specify column (tbl_fiscal_year_id in case) tblfiscalyear referring to:
static mapping = { table 'tblaccessright' id column: "rightid", generator: "assigned",name:'rightid' tblfiscalyear column: 'tbl_fiscal_year_id' version false }
Comments
Post a Comment