若porperty指定formula属性,即该属性没有对应数据列,属性值由formula对应的SQL表达式生成.
xml形式:<property name="" formula="(select concat(tn.title,tn.content) from NEWS tn where tn.id=id)"></property>
注解形式:private String userName;
@Formula("(select t.user_name frome user_info t where t.user_id = user_id)")
public String getUserName(){
return username;
}