Fix ReSaveReferencedDeletedEntity for CockroachDB and HANA
This commit is contained in:
parent
e93a07b4f9
commit
32d1455326
|
@ -199,7 +199,7 @@ public class PostgreSQLLegacyDialect extends Dialect {
|
||||||
// "long" string types
|
// "long" string types
|
||||||
case LONG32VARCHAR:
|
case LONG32VARCHAR:
|
||||||
case LONG32NVARCHAR:
|
case LONG32NVARCHAR:
|
||||||
return "varchar";
|
return "text";
|
||||||
case BLOB:
|
case BLOB:
|
||||||
case CLOB:
|
case CLOB:
|
||||||
case NCLOB:
|
case NCLOB:
|
||||||
|
@ -232,9 +232,10 @@ public class PostgreSQLLegacyDialect extends Dialect {
|
||||||
case NCHAR:
|
case NCHAR:
|
||||||
case VARCHAR:
|
case VARCHAR:
|
||||||
case NVARCHAR:
|
case NVARCHAR:
|
||||||
|
return "varchar";
|
||||||
case LONG32VARCHAR:
|
case LONG32VARCHAR:
|
||||||
case LONG32NVARCHAR:
|
case LONG32NVARCHAR:
|
||||||
return "varchar";
|
return "text";
|
||||||
case BINARY:
|
case BINARY:
|
||||||
case VARBINARY:
|
case VARBINARY:
|
||||||
case LONG32VARBINARY:
|
case LONG32VARBINARY:
|
||||||
|
|
|
@ -220,7 +220,7 @@ public class PostgreSQLDialect extends Dialect {
|
||||||
// since there's no real difference between TEXT and VARCHAR,
|
// since there's no real difference between TEXT and VARCHAR,
|
||||||
// except for the length limit, we can just use 'text' for the
|
// except for the length limit, we can just use 'text' for the
|
||||||
// "long" string types
|
// "long" string types
|
||||||
case LONG32VARCHAR, LONG32NVARCHAR -> "varchar";
|
case LONG32VARCHAR, LONG32NVARCHAR -> "text";
|
||||||
|
|
||||||
// use oid as the blob/clob type on Postgres because
|
// use oid as the blob/clob type on Postgres because
|
||||||
// the JDBC driver doesn't allow using bytea/text via
|
// the JDBC driver doesn't allow using bytea/text via
|
||||||
|
@ -246,7 +246,8 @@ public class PostgreSQLDialect extends Dialect {
|
||||||
@Override
|
@Override
|
||||||
protected String castType(int sqlTypeCode) {
|
protected String castType(int sqlTypeCode) {
|
||||||
return switch (sqlTypeCode) {
|
return switch (sqlTypeCode) {
|
||||||
case CHAR, NCHAR, VARCHAR, NVARCHAR, LONG32VARCHAR, LONG32NVARCHAR -> "varchar";
|
case CHAR, NCHAR, VARCHAR, NVARCHAR -> "varchar";
|
||||||
|
case LONG32VARCHAR, LONG32NVARCHAR -> "text";
|
||||||
case BINARY, VARBINARY, LONG32VARBINARY -> "bytea";
|
case BINARY, VARBINARY, LONG32VARBINARY -> "bytea";
|
||||||
default -> super.castType( sqlTypeCode );
|
default -> super.castType( sqlTypeCode );
|
||||||
};
|
};
|
||||||
|
|
|
@ -76,8 +76,9 @@ public class ReSaveReferencedDeletedEntity extends BaseCoreFunctionalTestCase {
|
||||||
@Entity(name = "Child")
|
@Entity(name = "Child")
|
||||||
public static class Child {
|
public static class Child {
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
private String name;
|
||||||
|
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
return id;
|
return id;
|
||||||
|
@ -91,7 +92,7 @@ public class ReSaveReferencedDeletedEntity extends BaseCoreFunctionalTestCase {
|
||||||
@Entity(name = "Parent")
|
@Entity(name = "Parent")
|
||||||
public static class Parent {
|
public static class Parent {
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
@OneToOne(cascade = CascadeType.ALL)
|
@OneToOne(cascade = CascadeType.ALL)
|
||||||
|
|
Loading…
Reference in New Issue