Skip to content

Commit

Permalink
Column use `` for reserved key (#743)
Browse files Browse the repository at this point in the history
* fix weird prefixes keys when use RedisUtils.scan

* Column use `` for reserved key

ref: https://stackoverflow.com/questions/2224503/how-to-map-an-entity-field-whose-name-is-a-reserved-word-in-jpa
  • Loading branch information
aborn committed May 31, 2022
1 parent d4ae410 commit 68608b2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class ${className} implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY)
</#if>
</#if>
@Column(name = "${column.columnName}"<#if column.columnKey = 'UNI'>,unique = true</#if><#if column.istNotNull && column.columnKey != 'PRI'>,nullable = false</#if>)
@Column(name = "`${column.columnName}`"<#if column.columnKey = 'UNI'>,unique = true</#if><#if column.istNotNull && column.columnKey != 'PRI'>,nullable = false</#if>)
<#if column.istNotNull && column.columnKey != 'PRI'>
<#if column.columnType = 'String'>
@NotBlank
Expand All @@ -82,4 +82,4 @@ public class ${className} implements Serializable {
public void copy(${className} source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
}
}
}

0 comments on commit 68608b2

Please sign in to comment.