Skip to content

Commit

Permalink
#2 jpa Entity nullable 정의 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
Qbeom0925 committed Aug 17, 2024
1 parent 6aa0893 commit a61c9ce
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ class MealJpaEntity {

@Column(name = "type", length = 20)
@Enumerated(EnumType.STRING)
var type: MealType? = null
var type: MealType? = MealType.LUNCH

@Column(name = "status", length = 20)
@Enumerated(EnumType.STRING)
var status: MealStatus? = null
var status: MealStatus? = MealStatus.OPEN

@Comment("식사 가격")
@Column(name = "price")
var price: BigDecimal = BigDecimal.ZERO

@ManyToOne
@JoinColumn(name = "meal_id")
var restaurant: Restaurant? = null
var restaurantJpaEntity: RestaurantJpaEntity? = null


}
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ import jakarta.persistence.*
@Table(name = "restaurant", indexes = [
Index(name = "idx_name", columnList = "name"),
])
class Restaurant {
class RestaurantJpaEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
val idx: Long? = null
val idx: Long = 0

@Column(name = "name")
val name: String? = null
val name: String = "DEFAULT"

@Column(name = "address")
val address: String? = null
val address: String = "DEFAULT"

@ManyToOne
@JoinColumn(name = "category_id")
val university: University? = null
val universityJpaEntity: UniversityJpaEntity? = null


}
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
package com.core.adapter.out.persistence.entity

import jakarta.persistence.*
import jakarta.persistence.criteria.CriteriaBuilder.In

@Entity
@Table(name = "university", indexes = [
Index(name = "idx_name", columnList = "name"),
])
class University {
class UniversityJpaEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
val idx: Long? = null

@Column(name = "name")
val name: String? = null
val name: String = "DEFAULT"

@Column(name = "campus_name")
val campusName: String? = null
val campusName: String = "DEFAULT"

@Column(name = "is_deleted")
val isDeleted: Boolean? = null
val isDeleted: Boolean = true
}

0 comments on commit a61c9ce

Please sign in to comment.