Table 1:-
--
-- Table structure for table page
--
DROP TABLE IF EXISTS `page`;
CREATE TABLE IF NOT EXISTS `page` (
`id` int(11) NOT NULL,
`site_id` int(11) NOT NULL,
`keyword_id` int(11) NOT NULL,
`state` char(2) DEFAULT NULL,
`location_group_id` int(11) DEFAULT NULL,
`location_id` int(11) DEFAULT NULL,
`uri` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7194 ;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `page`
--
ALTER TABLE `page`
ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `site_id` (`site_id`,`uri`),
ADD KEY `location_group_id` (`location_group_id`),
ADD KEY `keyword_id` (`keyword_id`), ADD KEY `uri` (`uri`),
ADD KEY `state` (`state`), ADD KEY `location_id` (`location_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `page`
--
ALTER TABLE `page`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=7194;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `page`
--
ALTER TABLE `page`
ADD CONSTRAINT `page_ibfk_1` FOREIGN KEY (`site_id`) REFERENCES `site` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `page_ibfk_2` FOREIGN KEY (`keyword_id`) REFERENCES `keyword` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
**ADD CONSTRAINT `page_ibfk_3` FOREIGN KEY (`state`) REFERENCES `state` (`abbreviation`) ON DELETE CASCADE ON UPDATE CASCADE,**
ADD CONSTRAINT `page_ibfk_4` FOREIGN KEY (`location_group_id`) REFERENCES `location_group` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `page_ibfk_5` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
Table 2:-
--
-- Table structure for table `state`
--
CREATE TABLE IF NOT EXISTS `state` (
`id` int(11) NOT NULL,
`abbreviation` char(2) NOT NULL,
`name` varchar(255) NOT NULL,
`territory` tinyint(1) DEFAULT '0',
`capital_city` varchar(255) DEFAULT NULL,
`nickname` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=56 ;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `state`
--
ALTER TABLE `state`
ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `abbreviation` (`abbreviation`),
ADD UNIQUE KEY `name` (`name`), ADD KEY `abbreviation_2` (`abbreviation`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `state`
--
ALTER TABLE `state`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=56;
Please check the unique key relationship between the state table and page table and help me how can i identify this relationship during create my new Entity for this type of DB structure.