forked from solid-connection/solid-connect-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNews.java
More file actions
59 lines (47 loc) · 1.33 KB
/
News.java
File metadata and controls
59 lines (47 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package com.example.solidconnection.news.domain;
import com.example.solidconnection.common.BaseEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@Entity
@NoArgsConstructor
@EqualsAndHashCode
public class News extends BaseEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String title;
private String description;
@Column(length = 500)
private String thumbnailUrl;
@Column(length = 500)
private String url;
public News(
String title,
String description,
String thumbnailUrl,
String url) {
this.title = title;
this.description = description;
this.thumbnailUrl = thumbnailUrl;
this.url = url;
}
public void updateTitle(String title) {
this.title = title;
}
public void updateDescription(String description) {
this.description = description;
}
public void updateUrl(String url) {
this.url = url;
}
public void updateThumbnailUrl(String thumbnailUrl) {
this.thumbnailUrl = thumbnailUrl;
}
}