一对多条件查询?根据用户查询用户下的所有好友的通讯录然后条件查询通讯录中的某一个好友

public class Users implements java.io.Serializable {

// Fields

private Integer userid;
private String uname;
private String upwd;
private Set messageses = new HashSet(0);

}


usersxml------


<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">






users_seq















users对应的message

public class Messages implements java.io.Serializable {

// Fields

private Integer mid;
private Users users;
private String mname;
private Long phone;


}


Messages.xml---------------------

<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">






messages_seq


















需求:用户users登录后,显示此用户下的所有好友通讯录message,然后根据电话查询查询具体的message信息?

刚开始学 ,求大神赐教,再次感谢!

查看全部
qq_21199331
小楼昨夜又秋风
2015/09/14 05:28
  • 一对多条件查询问题
  • 点赞
  • 收藏
  • 回答
    私信

2个回复