Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. package br.com.mowa.comunicador.model;
  2.  
  3. import java.io.Serializable;
  4.  
  5. import javax.persistence.Column;
  6. import javax.persistence.Embeddable;
  7.  
  8. @Embeddable
  9. public class MwGroupUserPK implements Serializable {
  10.  
  11. private static final long serialVersionUID = 1L;
  12.  
  13. @Column(name = "id_user", insertable = false, updatable = false)
  14. private Integer idUser;
  15.  
  16. @Column(name = "id_group", insertable = false, updatable = false)
  17. private Integer idGroup;
  18.  
  19. public MwGroupUserPK() {
  20. }
  21.  
  22. public Integer getIdGroup() {
  23. return this.idGroup;
  24. }
  25.  
  26. public void setIdGroup(Integer idGroup) {
  27. this.idGroup = idGroup;
  28. }
  29.  
  30. public Integer getIdUser() {
  31. return this.idUser;
  32. }
  33.  
  34. public void setIdUser(Integer idUser) {
  35. this.idUser = idUser;
  36. }
  37.  
  38. public boolean equals(Object other) {
  39. if (this == other) {
  40. return true;
  41. }
  42. if (!(other instanceof MwGroupUserPK)) {
  43. return false;
  44. }
  45. MwGroupUserPK castOther = (MwGroupUserPK) other;
  46. return this.idGroup.equals(castOther.idGroup) && this.idUser.equals(castOther.idUser);
  47. }
  48.  
  49. public int hashCode() {
  50. final int prime = 31;
  51. int hash = 17;
  52. hash = hash * prime + this.idGroup.hashCode();
  53. hash = hash * prime + this.idUser.hashCode();
  54.  
  55. return hash;
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement