Hello,
I'm using two Mysql database with foreign key and constraints from one table to another :
CREATE SCHEMA IF NOT EXISTS `client` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
CREATE SCHEMA IF NOT EXISTS `referencial` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
CREATE TABLE IF NOT EXISTS `referencial`.`NETWORK` (
`NETWORK_ID` VARCHAR(45) NULL ,
`NETWORK_NAME` VARCHAR(45) NULL ,
PRIMARY KEY (`NETWORK_ID`) )
ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS `client`.`COMPANY` (
`COMPANY_ID` VARCHAR(45) NOT NULL ,
`NETWORK_ID` VARCHAR(45) NULL ,
`COMPANY_NAME` VARCHAR(45) NULL ,
PRIMARY KEY (`COMPANY_ID`) ,
CONSTRAINT `fk_COMPANY_NETWORK`
FOREIGN KEY (`NETWORK_ID` )
REFERENCES `referencial`.`NETWORK` (`NETWORK_ID` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
CREATE INDEX fk_COMPANY_NETWORK ON `client`.`COMPANY` (`NETWORK_ID` ASC) ;
When I build my Hibernate configuration, I have two config files : each one contain the connection parameters for one database and the mapping of one table.
How could I map my two table, with for example a many-to-one relation from one file to another ?
Thanks,
|