many
package test;
import java
import java
/** *//**
* @hibernate
*/
public class Position
private int id;
private int name;
private Set<Users> users = new TreeSet<Users>();
/** *//**
* @hibernate
*/
public int getId()
return id;
}
public void setId(int id)
this
}
/** *//**
* @hibernate
*/
public int getName()
return name;
}
public void setName(int name)
this
}
/** *//**
* @hibernate
* llection
* llection
*/
public Set<Users> getUsers()
return users;
}
public void setUsers(Set<Users> users)
this
}
}
package test;
import java
import java
/** *//**
* @hibernate
*/
public class Position
private int id;
private int name;
private Set<Users> users = new TreeSet<Users>();
/** *//**
* @hibernate
*/
public int getId()
return id;
}
public void setId(int id)
this
}
/** *//**
* @hibernate
*/
public int getName()
return name;
}
public void setName(int name)
this
}
/** *//**
* @hibernate
* llection
* llection
*/
public Set<Users> getUsers()
return users;
}
public void setUsers(Set<Users> users)
this
}
}
package test;
import java
import java
/** *//**
* @hibernate
*/
public class Position
private int id;
private int name;
private Set<Users> users = new TreeSet<Users>();
/** *//**
* @hibernate
*/
public int getId()
return id;
}
public void setId(int id)
this
}
/** *//**
* @hibernate
*/
public int getName()
return name;
}
public void setName(int name)
this
}
/** *//**
* @hibernate
* llection
* llection
*/
public Set<Users> getUsers()
return users;
}
public void setUsers(Set<Users> users)
this
}
}
接下來是Users
Java代碼
package test;
import java
/** *//**
* @hibernate
*/
public class Users
private int id;
private String name;
private Set<Position> positions = new TreeSet<Position>();
/** *//**
* @hibernate
*/
public int getId()
return id;
}
public void setId(int id)
this
}
/** *//**
* @hibernate
*/
public String getName()
return name;
}
public void setName(String name)
this
}
/** *//**
* @hibernate
* llection
* llection
*/
public Set<Position> getPositions()
return positions;
}
public void setPositions(Set<Position> positions)
this
}
}
view plaincopy to clipboardprint?
package test;
import java
/** *//**
* @hibernate
*/
public class Users
private int id;
private String name;
private Set<Position> positions = new TreeSet<Position>();
/** *//**
* @hibernate
*/
public int getId()
return id;
}
public void setId(int id)
this
}
/** *//**
* @hibernate
*/
public String getName()
return name;
}
public void setName(String name)
this
}
/** *//**
* @hibernate
* llection
* llection
*/
public Set<Position> getPositions()
return positions;
}
public void setPositions(Set<Position> positions)
this
}
}
package test;
import java
/** *//**
* @hibernate
*/
public class Users
private int id;
private String name;
private Set<Position> positions = new TreeSet<Position>();
/** *//**
* @hibernate
*/
public int getId()
return id;
}
public void setId(int id)
this
}
/** *//**
* @hibernate
*/
public String getName()
return name;
}
public void setName(String name)
this
}
/** *//**
* @hibernate
* llection
* llection
*/
public Set<Position> getPositions()
return positions;
}
public void setPositions(Set<Position> positions)
this
}
}
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28643.html