Asgnmt_master (GeneratedId assignmentId) { Asgnmt_master am = Asgnmt_master.load(assignmentId); if(am.isAggregate() || am.isSingle()) { return am; } //If it's not a single or aggregate, we need to load the aggregate and load that. return Asgnmt_master.load(am.getAggregate_asgnmt()); }