这是一个StudentMapper的xml配置文件
数据库里phone是VARCHAR类型xxx-xxx-xxx这种的,我想把phone根据“-”分割然后映射给Student里的phone但是做不到
这个能达到吗
<resultMap type="Student" id="StudentWithAddressResult">
<id property="studId" column="id" />
<result property="name" column="name" />
<result property="email" column="email" />
<result property="dob" column="dob" />
<!-- 重点下面这一行 -->
<result property="phone" column="phone" />
<association property="address" javaType="Address">
<id property="addrId" column="addr_id"/>
<result property="street" column="street"/>
<result property="city" column="city"/>
<result property="state" column="state"/>
<result property="zip" column="zip"/>
<result property="country" column="country"/>
</association>
</resultMap>
这是Student类
private Integer studId;
private String name;
private String email;
private Date dob;
private PhoneNumber phone;
//private String phone;
private Address address;
public Student() {}
这是PhoneNumber类
private String countryCode;
private String stateCode;
private String number;
public PhoneNumber() {}