notification-service에 jpa 설계
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package com.justpickup.notificationservice.domain.notification.entity;
|
||||
|
||||
import com.justpickup.notificationservice.global.entity.BaseEntity;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name = "notification")
|
||||
@Getter
|
||||
@NoArgsConstructor(access = AccessLevel.PROTECTED)
|
||||
public class Notification extends BaseEntity {
|
||||
|
||||
@Id @GeneratedValue
|
||||
@Column(name = "notification_id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* userdb.users.user_id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.justpickup.notificationservice.global.entity;
|
||||
|
||||
|
||||
import javax.persistence.MappedSuperclass;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@MappedSuperclass
|
||||
public abstract class BaseEntity {
|
||||
|
||||
private LocalDateTime createdAt;
|
||||
private Long createdBy;
|
||||
private LocalDateTime lastModifiedAt;
|
||||
private Long lastModifiedBy;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user