ssh中怎么修改级联对象值

泪的告白篇 泪的告白篇 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

public String save(){

if(id == null){

model.setCreatetime(new Date());
}

System.out.println(model);
employeeService.saveorupdate(model);
return SUCCESS;
}

jsp的页面代码

<s:select list="#request.departments"
listKey="id" listValue="departname" name="department.id" label="Department"></s:select>


<class name="com.czf.ssh.entities.Employee" table="ssh_employees" >

<id name="id" column="id" type="integer">
<generator class="native"></generator>
</id>
<property name="lastname" column="lastname" type="string"/>

<property name="email" column="email" type="string"></property>

<property name="birth" column="birth" type="date"></property>

<property name="createtime" column="createtime" type="date"></property>

<!-- 映射单向 n-1 的关联关系 -->
<many-to-one name="department" class="com.czf.ssh.entities.Department" column="dept_id" cascade="all"></many-to-one>
</class>

这张是ssh_employee的表

这张是ssh_departmente的表

现在我怎么从jsp页面传参给dept_id 让它更新
求方法 各位大神
...全文
评论
收藏 已收藏
分享
返回顶部
泪的告白篇
Java EE 67,535 成员 225,843 内容