Skip to content

Commit ced562a

Browse files
committed
Fix entity definitions
1 parent 6a1793b commit ced562a

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

backend/src/main/kotlin/hu/bme/sch/cmsch/component/key/AccessKeyEntity.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import hu.bme.sch.cmsch.model.RoleType
99
import hu.bme.sch.cmsch.service.StaffPermissions
1010
import jakarta.persistence.*
1111
import org.hibernate.Hibernate
12+
import org.hibernate.annotations.ColumnDefault
1213
import org.hibernate.annotations.JdbcTypeCode
1314
import org.hibernate.type.SqlTypes
1415
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean
@@ -34,7 +35,8 @@ data class AccessKeyEntity(
3435
var accessKey: String = "",
3536

3637
@field:JsonView(value = [ Edit::class ])
37-
@Column(nullable = false, columnDefinition = "VARCHAR(255) DEFAULT ''")
38+
@ColumnDefault("''")
39+
@Column(nullable = false, columnDefinition = "VARCHAR(255)")
3840
@property:GenerateInput(maxLength = 128, order = 2, label = "Cimke",
3941
note = "Például a név aminek majd szerepelnie kellene")
4042
@property:GenerateOverview(columnName = "Cimke", order = 3)
@@ -121,4 +123,4 @@ data class AccessKeyEntity(
121123
return "AccessKeyEntity(id=$id, accessKey='$accessKey', usedByUserName='$usedByUserName', usedAt=$usedAt)"
122124
}
123125

124-
}
126+
}

backend/src/main/kotlin/hu/bme/sch/cmsch/component/task/TaskCategoryEntity.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ data class TaskCategoryEntity(
9292

9393
@Enumerated(EnumType.STRING)
9494
@JdbcTypeCode(SqlTypes.VARCHAR)
95-
@Column(nullable = false, columnDefinition = "VARCHAR(255) default 'BASIC'")
95+
@ColumnDefault("'BASIC'")
96+
@Column(nullable = false, columnDefinition = "VARCHAR(255)")
9697
@field:JsonView(value = [ Edit::class ])
9798
@property:GenerateInput(type = INPUT_TYPE_BLOCK_SELECT, order = 8,
9899
label = "Minimum rang a megtekintéshez",
@@ -105,7 +106,8 @@ data class TaskCategoryEntity(
105106

106107
@Enumerated(EnumType.STRING)
107108
@JdbcTypeCode(SqlTypes.VARCHAR)
108-
@Column(nullable = false, columnDefinition = "VARCHAR(255) default 'SUPERUSER'")
109+
@ColumnDefault("'SUPERUSER'")
110+
@Column(nullable = false, columnDefinition = "VARCHAR(255)")
109111
@field:JsonView(value = [ Edit::class ])
110112
@property:GenerateInput(type = INPUT_TYPE_BLOCK_SELECT, order = 9,
111113
label = "Maximum rang a megtekintéshez",

backend/src/main/kotlin/hu/bme/sch/cmsch/component/task/TaskEntity.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import hu.bme.sch.cmsch.model.RoleType
1111
import hu.bme.sch.cmsch.service.StaffPermissions
1212
import jakarta.persistence.*
1313
import org.hibernate.Hibernate
14+
import org.hibernate.annotations.ColumnDefault
1415
import org.hibernate.annotations.JdbcTypeCode
1516
import org.hibernate.type.SqlTypes
1617
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean
@@ -161,7 +162,8 @@ data class TaskEntity(
161162

162163
@Enumerated(EnumType.STRING)
163164
@JdbcTypeCode(SqlTypes.VARCHAR)
164-
@Column(nullable = false, columnDefinition = "VARCHAR(255) default 'BASIC'")
165+
@ColumnDefault("'BASIC'")
166+
@Column(nullable = false, columnDefinition = "VARCHAR(255)")
165167
@field:JsonView(value = [ Edit::class ])
166168
@property:GenerateInput(type = INPUT_TYPE_BLOCK_SELECT, order = 15,
167169
label = "Minimum rang a megtekintéshez",
@@ -174,7 +176,8 @@ data class TaskEntity(
174176

175177
@Enumerated(EnumType.STRING)
176178
@JdbcTypeCode(SqlTypes.VARCHAR)
177-
@Column(nullable = false, columnDefinition = "VARCHAR(255) default 'SUPERUSER'")
179+
@ColumnDefault("'SUPERUSER'")
180+
@Column(nullable = false, columnDefinition = "VARCHAR(255)")
178181
@field:JsonView(value = [ Edit::class ])
179182
@property:GenerateInput(type = INPUT_TYPE_BLOCK_SELECT, order = 16,
180183
label = "Maximum rang a megtekintéshez",

0 commit comments

Comments
 (0)