Merge pull request #7 from Development-team-1/notification-service-jpa-design

Notification service jpa design
This commit is contained in:
Sangbum Park
2022-01-26 17:54:18 +09:00
committed by GitHub
3 changed files with 48 additions and 8 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -10,15 +10,15 @@ spring:
username: postgres
password: admin
jpa:
jpa:
hibernate:
ddl-auto: create-drop
properties:
hibernate:
ddl-auto: create-drop
properties:
hibernate:
format_sql: true
show_sql: true
open-in-view: false
default_batch_fetch_size: 1000
format_sql: true
show_sql: true
open-in-view: false
default_batch_fetch_size: 1000
eureka:
client: