请问:在mysql中创建的两个表
create table page(
page_id int(7) not null auto_increment,
page_name varchar(50) not null,
page_profile varchar(255),
primary key (page_id),
);

create table post(
post_id int(7) not null auto_increment,
page_id int(7) not null,
post_title varchar(50) not null,
post_content text not null,
issue_time datetime,
click_count smallint default 0,
isTop bool default false,
isGood bool default false,
primary key (post_id),
foreign key (page_id) references page(page_id),
);
在用myeclipse自动生成bean文件和hdm.xml后,发现外键page_id映射过来后变成了对象page(private Page page)。
在DAO里面写函数执行hql语句:“from Post where pageId=?”时,出现(could not execute query)错误。
想问一下这是为什么?
对映射过来的page对象的page_id如何进行select操作呢?
post映射过来后没有了page_id这个属性