Skip to content

Commit

Permalink
Feat: Add language column
Browse files Browse the repository at this point in the history
  • Loading branch information
huGgW committed Mar 1, 2024
1 parent 5b7aa1e commit a103631
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.wafflestudio.csereal.core.research.database

import com.wafflestudio.csereal.common.config.BaseTimeEntity
import com.wafflestudio.csereal.common.properties.LanguageType
import com.wafflestudio.csereal.common.utils.cleanTextFromHtml
import com.wafflestudio.csereal.core.conference.database.ConferenceEntity
import jakarta.persistence.*
Expand All @@ -10,6 +11,9 @@ class ResearchSearchEntity(
@Column(columnDefinition = "TEXT")
var content: String,

@Enumerated(value = EnumType.STRING)
val language: LanguageType,

@OneToOne
@JoinColumn(name = "research_id")
val research: ResearchEntity? = null,
Expand All @@ -26,20 +30,23 @@ class ResearchSearchEntity(
fun create(research: ResearchEntity): ResearchSearchEntity {
return ResearchSearchEntity(
content = createContent(research),
language = research.language,
research = research
)
}

fun create(lab: LabEntity): ResearchSearchEntity {
return ResearchSearchEntity(
content = createContent(lab),
language = lab.language,
lab = lab
)
}

fun create(conference: ConferenceEntity): ResearchSearchEntity {
return ResearchSearchEntity(
content = createContent(conference),
language = conference.language,
conferenceElement = conference
)
}
Expand Down

0 comments on commit a103631

Please sign in to comment.