All pastes #2461182 Raw Edit

Mine

public unlisted java v1 · immutable
#2461182 ·published 2013-10-02 14:58 UTC
rendered paste body
String queryString = "SELECT boardList FROM BoardPrivileges AS boardPrivs " +                         "WHERE boardPrivs.userList = :user";@Entitypublic class Users {    @Id    @GeneratedValue    private Long id;    private String type; // admin / teamlead / normal    private String name;    private boolean isAdmin;        @ManyToOne    private Companies company;    @ManyToMany    private Collection<BoardPrivileges> boardPrivilegsList =  new ArrayList<BoardPrivileges>();@Entitypublic class BoardPrivileges {    @Id    @GeneratedValue    private Long id;    @ManyToMany  (mappedBy = "boardPrivilegsList")    private Collection<Users> userList = new ArrayList<Users>();    @ManyToMany  (mappedBy = "boardPrivilegesList")    private Collection<Boards> boardList = new ArrayList<Boards>();    //This Board    private boolean isCreater; //is creater of this board    private boolean canRead;    private boolean canUpdate;    private boolean canDelete;@Entitypublic class Boards {    @Id    @GeneratedValue    private Long id;    private String title;    private String description;    @ManyToOne    private Companies company;    @ManyToMany    private Collection<BoardPrivileges> boardPrivilegesList = new ArrayList<BoardPrivileges>();