NetBeans 6.7 Beta を使用して、MySQL (バージョン '5.0.45-log') データベースからエンティティ クラスを作成しています。NetBeans はほとんどのテーブルを受け入れますが、「主キーがない」と言って、特定のテーブルを一貫して拒否します (パターンはわかりません)。すべてのテーブルは InnoDB エンジンを使用しています。すべてのテーブルには、1 つ以上の列の主キーがあります。MySQL クエリ ブラウザと NetBeans の内部データベース ナビゲータはどちらも、実際にはすべてのテーブルに主キーがあることに同意しています。調子はどう?
以下は、不適切なテーブルを生成するスクリプト スニペットです。
-- -----------------------------------------------------
-- Table `beamline`.`rq_requests`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `beamline`.`rq_requests` (
`id` INT NOT NULL AUTO_INCREMENT ,
`facility_id` INT NOT NULL ,
`schedule_id` INT NOT NULL ,
`experiment_id` INT NOT NULL ,
`person_id` INT NOT NULL ,
`shift_per_block` INT NOT NULL ,
`block_count` INT NOT NULL ,
`other_requirment` VARCHAR(1023) NULL ,
`submitted` BOOLEAN NOT NULL ,
`date_modified` DATETIME NOT NULL ,
`date_created` DATETIME NOT NULL ,
PRIMARY KEY (`id`) ,
INDEX `fk_rq_requests_xa_facilities` (`facility_id` ASC) ,
INDEX `fk_rq_requests_xa_schedules` (`schedule_id` ASC) ,
INDEX `fk_rq_requests_eec_exp_toc` (`experiment_id` ASC)
# ,INDEX `fk_rq_requests_eec_members` (`person_id` ASC)
,CONSTRAINT `fk_rq_requests_xa_facilities`
FOREIGN KEY (`facility_id` )
REFERENCES `beamline`.`xa_facilities` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION
,CONSTRAINT `fk_rq_requests_xa_schedules`
FOREIGN KEY (`schedule_id` )
REFERENCES `beamline`.`xa_schedules` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION
,CONSTRAINT `fk_rq_requests_eec_exp_toc`
FOREIGN KEY (`experiment_id` )
REFERENCES `beamline`.`eec_exp_toc` (`exp_id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION
# ,CONSTRAINT `fk_rq_requests_eec_members`
# FOREIGN KEY (`person_id` )
# REFERENCES `beamline`.`rq_questions` (`admin_uid` )
# ON DELETE NO ACTION
# ON UPDATE NO ACTION
)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `beamline`.`rq_questions_facilities`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `beamline`.`rq_questions_facilities` (
`facility_id` INT NOT NULL ,
`question_id` INT NOT NULL ,
PRIMARY KEY (`facility_id`, `question_id`) ,
INDEX `fk_req_faciliy_current_question_req_question` (`question_id` ASC) ,
INDEX `fk_rq_questions_facilities_xa_facilities` (`facility_id` ASC),
CONSTRAINT `fk_req_faciliy_current_question_req_question`
FOREIGN KEY (`question_id` )
REFERENCES `beamline`.`rq_questions` (`id` )
ON DELETE CASCADE
ON UPDATE CASCADE,
CONSTRAINT `fk_rq_questions_facilities_xa_facilities`
FOREIGN KEY (`facility_id` )
REFERENCES `beamline`.`xa_facilities` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION
)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `beamline`.`rq_questions_supressed`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `beamline`.`rq_questions_suppressed` (
`facility_id` INT NOT NULL ,
`question_id` INT NOT NULL ,
PRIMARY KEY (`facility_id`, `question_id`) ,
INDEX `fk_req_facility_suppressed_question_req_question` (`question_id` ASC) ,
INDEX `fk_rq_questions_suppressed_xa_facilities` (`facility_id` ASC),
CONSTRAINT `fk_req_facility_suppressed_question_req_question`
FOREIGN KEY (`question_id` )
REFERENCES `beamline`.`rq_questions` (`id` )
ON DELETE CASCADE
ON UPDATE CASCADE,
CONSTRAINT `fk_rq_questions_suppressed_xa_facilities`
FOREIGN KEY (`facility_id` )
REFERENCES `beamline`.`xa_facilities` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
何を与える?前もって感謝します。