daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Apr 27th, 2016 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Entity
  2. @Table(name = "user")
  3. @XmlRootElement
  4. @NamedQueries({
  5.     @NamedQuery(name = "User.findAll", query = "SELECT u FROM User u"),
  6.     @NamedQuery(name = "User.findByOid", query = "SELECT u FROM User u WHERE u.oid = :oid"),
  7.     @NamedQuery(name = "User.findByUsername", query = "SELECT u FROM User u WHERE u.username = :username"),
  8.     @NamedQuery(name = "User.findByPassword", query = "SELECT u FROM User u WHERE u.password = :password"),
  9.     @NamedQuery(name = "User.findByEmail", query = "SELECT u FROM User u WHERE u.email = :email"),
  10.     @NamedQuery(name = "User.findByAddress", query = "SELECT u FROM User u WHERE u.address = :address"),
  11.     @NamedQuery(name = "User.findBySince", query = "SELECT u FROM User u WHERE u.since = :since")})
  12. public class User implements Serializable {
  13.  
  14.     private static final long serialVersionUID = 1L;
  15.     @Id
  16.     @GeneratedValue(strategy = GenerationType.IDENTITY)
  17.     @Basic(optional = false)
  18.     @Column(name = "oid")
  19.     private Integer oid;
  20.     @Basic(optional = false)
  21.     @NotNull
  22.     @Size(min = 1, max = 15)
  23.     @Column(name = "username")
  24.     private String username;
  25.     @Basic(optional = false)
  26.     @NotNull
  27.     @Size(min = 1, max = 15)
  28.     @Column(name = "password")
  29.     private String password;
  30.     // @Pattern(regexp="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", message="Invalid email")//if the field contains email address consider using this annotation to enforce field validation
  31.     @Basic(optional = false)
  32.     @NotNull
  33.     @Size(min = 1, max = 30)
  34.     @Column(name = "email")
  35.     private String email;
  36.     @Size(max = 50)
  37.     @Column(name = "address")
  38.     private String address;
  39.     @Basic(optional = false)
  40.     @NotNull
  41.     @Column(name = "since")
  42.     @Temporal(TemporalType.DATE)
  43.     private Date since;
  44.     @JoinTable(name = "favorite", joinColumns = {
  45.         @JoinColumn(name = "user_oid", referencedColumnName = "oid")}, inverseJoinColumns = {
  46.         @JoinColumn(name = "wheelchair_oid", referencedColumnName = "oid")})
  47.     @ManyToMany
  48.     private List<Wheelchair> wheelchairList;
  49.     @ManyToMany(mappedBy = "userList1")
  50.     private List<Wheelchair> wheelchairList1;
  51.     @OneToMany(cascade = CascadeType.ALL, mappedBy = "senderOid")
  52.     private List<Comment> commentList;
  53.     @JoinColumn(name = "role_oid", referencedColumnName = "oid")
  54.     @ManyToOne(optional = false)
  55.     private Role roleOid;
  56.     @OneToMany(cascade = CascadeType.ALL, mappedBy = "userOid")
  57.     private List<Orthopedy> orthopedyList;
  58.  
  59.     public User() {
  60.     }
  61. ...
  62.    
  63. @OneToMany(cascade = CascadeType.ALL, mappedBy = "userOid")
  64.     private List<Orthopedy> orthopedyList;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top