-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb3eaf9
commit 9047fde
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.steady.steadyback.domain; | ||
|
||
import com.sun.istack.NotNull; | ||
import lombok.Builder; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.persistence.*; | ||
|
||
@Entity | ||
@NoArgsConstructor | ||
@Table(name = "alarm") | ||
public class Alarm { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@NotNull | ||
@ManyToOne | ||
@JoinColumn(name = "user_id") | ||
private User user; | ||
|
||
@NotNull | ||
@Column(name = "read_flag") | ||
private Boolean readFlag; | ||
|
||
@NotNull | ||
@Column(length = 100) | ||
private String message; | ||
|
||
@NotNull | ||
@Column | ||
private Integer type; | ||
|
||
@Builder | ||
public Alarm(User user, Boolean readFlag, String message, Integer type) { | ||
this.user = user; | ||
this.readFlag = readFlag; | ||
this.message = message; | ||
this.type = type; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/steady/steadyback/domain/AlarmRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.steady.steadyback.domain; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface AlarmRepository extends JpaRepository<Alarm, Long> { | ||
} |