main
Last change
on this file since 2a5d6a3 was 2a5d6a3, checked in by Petar Partaloski <ppartaloski@…>, 2 years ago |
Controller, Repository and Service layer improvements, Entity updating
|
-
Property mode
set to
100644
|
File size:
598 bytes
|
Rev | Line | |
---|
[6e7b472] | 1 | package com.wediscussmovies.project.model;
|
---|
| 2 |
|
---|
[7a0bf79] | 3 | import lombok.Data;
|
---|
| 4 |
|
---|
[2a5d6a3] | 5 | import javax.persistence.*;
|
---|
[6e7b472] | 6 |
|
---|
[7a0bf79] | 7 | @Data
|
---|
[2a5d6a3] | 8 | @Entity
|
---|
| 9 | @Table(name="genres")
|
---|
[6e7b472] | 10 | public class Genre {
|
---|
| 11 | @Id
|
---|
| 12 | @GeneratedValue
|
---|
| 13 | @Column(name="genre_id", nullable = false, unique = true)
|
---|
| 14 | private int genre_id;
|
---|
| 15 |
|
---|
| 16 | @Column(name="genre_type", length = 100, nullable = false, unique = true)
|
---|
| 17 | private String genre_type;
|
---|
[7a0bf79] | 18 |
|
---|
| 19 | public Genre(String genreName) {
|
---|
| 20 | this.genre_type = genreName;
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | public Genre() {
|
---|
| 24 | }
|
---|
[6e7b472] | 25 | }
|
---|
| 26 |
|
---|
| 27 | /*
|
---|
| 28 |
|
---|
| 29 | create table genres(
|
---|
| 30 | genre_id serial primary key,
|
---|
| 31 | genre_type varchar(100) not null unique
|
---|
| 32 | );
|
---|
| 33 |
|
---|
| 34 | */ |
---|
Note:
See
TracBrowser
for help on using the repository browser.