我为我的 android 应用程序创建了数据库,女巫有 16 个表。我想使用 ORMlite 映射。问题是我没有找到您具有复合 id(多个主键)的示例。例如我有表:
CREATE TABLE IF NOT EXISTS `Tourist_Guide`.`Cultural_activity` (
`City_Id` INT NOT NULL ,
`activity_Id` INT NOT NULL ,
`Cultural_activity_Id` INT NOT NULL AUTO_INCREMENT ,
`Name_Of_Cultural_activity` VARCHAR(30) NOT NULL ,
PRIMARY KEY (`Cultural_activity_Id`, `City_Id`, `activity_Id`) ,
INDEX `fk_Cultural_activity_activity1` (`City_Id` ASC, `activity_Id` ASC) ,
CONSTRAINT `fk_Cultural_activity_activity1`
FOREIGN KEY (`City_Id` , `activity_Id` )
REFERENCES `Tourist_Guide`.`activity` (`City_Id` , `activity_Id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
你能告诉我如何将这个表映射到类(这个类应该是什么样子),这可能吗?