Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only cast LONG32 to text on PG to avoid type comparison related issues #9335

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ protected String castType(int sqlTypeCode) {
case NCHAR:
case VARCHAR:
case NVARCHAR:
return "varchar";
case LONG32VARCHAR:
case LONG32NVARCHAR:
return "text";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ protected String columnType(int sqlTypeCode) {
@Override
protected String castType(int sqlTypeCode) {
return switch (sqlTypeCode) {
case CHAR, NCHAR, VARCHAR, NVARCHAR, LONG32VARCHAR, LONG32NVARCHAR -> "text";
case CHAR, NCHAR, VARCHAR, NVARCHAR -> "varchar";
case LONG32VARCHAR, LONG32NVARCHAR -> "text";
case BINARY, VARBINARY, LONG32VARBINARY -> "bytea";
default -> super.castType( sqlTypeCode );
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ public void testReSaveDeletedEntityWithDetach() {
@Entity(name = "Child")
public static class Child {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@GeneratedValue
private Integer id;
private String name;

public Integer getId() {
return id;
Expand All @@ -87,7 +88,7 @@ public void setId(Integer id) {
@Entity(name = "Parent")
public static class Parent {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@GeneratedValue
private Integer id;

@OneToOne(cascade = CascadeType.ALL)
Expand Down