source: Git/src/main/java/com/wediscussmovies/project/model/User.java@ 7a0bf79

main
Last change on this file since 7a0bf79 was 7a0bf79, checked in by Petar Partaloski <ppartaloski@…>, 2 years ago

Early implementations, MovieController CRUD implementation included

  • Property mode set to 100644
File size: 1.2 KB
Line 
1package com.wediscussmovies.project.model;
2
3import lombok.Data;
4
5import javax.persistence.*;
6import java.util.List;
7
8@Data
9@Entity(name="users")
10public class User {
11 @Id
12 @GeneratedValue
13 @Column(name="user_id", nullable = false)
14 private int user_id;
15
16 @Column(name="username", length=50, nullable=false, unique=false)
17 private String username;
18
19 @Column(name="name", length=50, nullable=false, unique=false)
20 private String name;
21
22 @Column(name="surname", length=50, nullable=false, unique=false)
23 private String surname;
24
25 @Column(name="email", length=50, nullable=false, unique=false)
26 private String email;
27
28 @Column(name="password", length=100, nullable=false, unique=true)
29 private String password;
30
31 //TODO("RATES_MOVIE")
32 @ManyToMany(mappedBy = "movie_likes")
33 private List<Movie> likes_movie;
34
35 @ManyToMany(mappedBy = "user_genres")
36 private List<Genre> likes_genres;
37
38}
39
40
41/*
42 create table users(
43 user_id serial primary key,
44 username varchar(50) not null unique,
45 name varchar(50) not null,
46 surname varchar(50) not null,
47 email varchar(100) not null unique,
48 password varchar(30) not null,
49 constraint ck_password check(length(password) >= 9)
50 );
51 */
Note: See TracBrowser for help on using the repository browser.