Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
babyfish-ct committed Jan 8, 2025
1 parent cb4accb commit 4019b15
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion project/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
group=org.babyfish.jimmer
version=0.9.42
version=0.9.43
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ private static CodeBlock codeBlockOf(Anno.Value value) {
((Anno.EnumValue)value).constant
);
} else if (value instanceof Anno.LiteralValue) {
builder.add(((Anno.LiteralValue)value).value);
builder.add(((Anno.LiteralValue)value).value.replace("$", "$$"));
}
return builder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1822,7 +1822,7 @@ class DtoGenerator private constructor(
ClassName.bestGuess(value.qualifiedName),
value.constant
)
else -> add((value as LiteralValue).value)
else -> add((value as LiteralValue).value.replace("%", "%%"))
}
}

Expand Down
2 changes: 2 additions & 0 deletions project/jimmer-sql-kotlin/src/test/dto/Employee.dto
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export org.babyfish.jimmer.sql.kt.model.hr.Employee
-> package org.babyfish.jimmer.sql.kt.model.hr.dto

import com.fasterxml.jackson.annotation.JsonFormat
import com.fasterxml.jackson.databind.annotation.{JsonSerialize, JsonDeserialize}
import org.babyfish.jimmer.sql.kt.model.hr.{MagicStringSerializer, MagicStringDeserializer}

Expand All @@ -17,5 +18,6 @@ input EmployeeInput {

@JsonSerialize(using = MagicStringSerializer::class)
@JsonDeserialize(using = MagicStringDeserializer::class)
@JsonFormat(pattern = "[^%]+")
name
}
2 changes: 2 additions & 0 deletions project/jimmer-sql/src/test/dto/Personal.dto
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ PersonalPhoneView {
}

input PersonalPhoneInput {

@com.fasterxml.jackson.annotation.JsonFormat(pattern = "^\\d+$")
phone
}

0 comments on commit 4019b15

Please sign in to comment.