Hibernate version: 3
I new to Hibernate.
I have a table -
CREATE TABLE `frac_fshell_srv`.`frac75_organization_domain_geography_association` (
`ODGA_ID` char(7) NOT NULL,
`ODGA_ORG_ID` char(7) NOT NULL,
`ODGA_DM_ID` char(7) NOT NULL,
`ODGA_GM_ID` char(7) NOT NULL,
`ODGA_Created_By` char(7) NOT NULL,
`ODGA_Created_DateTime` datetime NOT NULL,
`ODGA_LastModified_By` char(7) NOT NULL,
`ODGA_LastModified_Datetime` datetime NOT NULL,
`ODGA_Archive_State` int(10) unsigned NOT NULL,
PRIMARY KEY (`ODGA_ID`),
KEY `FK_frac75_organization_domain_geography_association_ODGA_DM_ID` (`ODGA_DM_ID`),
KEY `FK_frac75_organization_domain_geography_association_ODGA_GM_ID` (`ODGA_GM_ID`),
CONSTRAINT `FK_frac75_organization_domain_geography_association_ODGA_GM_ID` FOREIGN KEY (`ODGA_GM_ID`) REFERENCES `frac75_geography_master` (`GM_ID`),
CONSTRAINT `FK_frac75_organization_domain_geography_association_ODGA_DM_ID` FOREIGN KEY (`ODGA_DM_ID`) REFERENCES `frac75_domain_master` (`DM_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
As you can see I want Hibernate to generate a query like this so that I can have a grid and display that to user.
The Select Statement -
Select .....DM_Name, .....GM_Name
from frac75_organization_domain_geography_association
inner join frac75_domain_master on dm_id=odga_dm_id
inner join frac75_geography_master on gm_id=odga_gm_id
Any Ideas Please?
|