|
|
|
@@ -1,14 +1,10 @@ |
|
|
|
package com.ffii.fpsms.modules.master.entity |
|
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonBackReference |
|
|
|
import com.fasterxml.jackson.annotation.JsonManagedReference |
|
|
|
import com.ffii.core.entity.BaseEntity |
|
|
|
import jakarta.persistence.CascadeType |
|
|
|
import jakarta.persistence.Column |
|
|
|
import jakarta.persistence.Entity |
|
|
|
import jakarta.persistence.JoinColumn |
|
|
|
import jakarta.persistence.JoinTable |
|
|
|
import jakarta.persistence.OneToMany |
|
|
|
import jakarta.persistence.Table |
|
|
|
import com.ffii.core.entity.IdEntity |
|
|
|
import jakarta.persistence.* |
|
|
|
import jakarta.validation.constraints.NotNull |
|
|
|
|
|
|
|
@Entity |
|
|
|
@@ -22,6 +18,14 @@ open class QcCategory : BaseEntity<Long>() { |
|
|
|
@Column(name = "name") |
|
|
|
open var name: String? = null |
|
|
|
|
|
|
|
@NotNull |
|
|
|
@Column(name = "description") |
|
|
|
open var description: String? = null |
|
|
|
|
|
|
|
@NotNull |
|
|
|
@Column(name = "isDefault") |
|
|
|
open var isDefault: Boolean = false |
|
|
|
|
|
|
|
// @OneToMany(cascade = [CascadeType.ALL]) |
|
|
|
// @JoinTable( |
|
|
|
// name = "qc_item_category", |
|
|
|
@@ -33,4 +37,24 @@ open class QcCategory : BaseEntity<Long>() { |
|
|
|
@JsonManagedReference |
|
|
|
@OneToMany(mappedBy = "qcCategory", cascade = [CascadeType.ALL], orphanRemoval = true) |
|
|
|
open var qcItemCategory: MutableList<QcItemCategory> = mutableListOf() |
|
|
|
} |
|
|
|
|
|
|
|
@Entity |
|
|
|
@Table(name = "items_qc_category_mapping") |
|
|
|
open class ItemsQcCategoryMapping : IdEntity<Long>() { |
|
|
|
@NotNull |
|
|
|
@Column(name = "itemId") |
|
|
|
open var itemId: Long? = null |
|
|
|
|
|
|
|
@NotNull |
|
|
|
@Column(name = "qcCategoryId") |
|
|
|
open var qcCategoryId: Long? = null |
|
|
|
|
|
|
|
@NotNull |
|
|
|
@Column(name = "type") |
|
|
|
open var type: String? = null |
|
|
|
// |
|
|
|
// @ManyToOne(fetch = FetchType.LAZY) |
|
|
|
// @JoinColumn(name = "qcCategoryId") |
|
|
|
// val qcCategory: QcCategory? = null |
|
|
|
} |