-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
241 changed files
with
11,551 additions
and
13,842 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
version=5.11.7 | ||
lombokVersion=1.18.30 | ||
springBootVersion=3.3.4 | ||
lombokVersion=1.18.34 | ||
jooqVersion=3.19.13 | ||
jdbcDriverVersion=42.7.3 | ||
jcloudsVersion=2.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#Fri Mar 13 21:13:13 MSK 2020 | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-all.zip | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
jdk: | ||
- openjdk11 | ||
- openjdk21 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 0 additions & 33 deletions
33
src/main/java/com/epam/ta/reportportal/commons/JsonbAwarePostgresDialect.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,36 +41,33 @@ | |
/** | ||
* @author <a href="mailto:[email protected]">Pavel Bortnik</a> | ||
*/ | ||
public abstract class JsonbUserType implements UserType { | ||
public abstract class JsonbUserType<T> implements UserType<T> { | ||
|
||
private final ObjectMapper mapper; | ||
|
||
public JsonbUserType() { | ||
protected JsonbUserType() { | ||
mapper = new ObjectMapper(); | ||
mapper.registerModule(new JavaTimeModule()); | ||
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); | ||
} | ||
|
||
@Override | ||
public int[] sqlTypes() { | ||
return new int[]{Types.JAVA_OBJECT}; | ||
public int getSqlType() { | ||
return Types.JAVA_OBJECT; | ||
} | ||
|
||
@Override | ||
abstract public Class<?> returnedClass(); | ||
|
||
@Override | ||
public Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, | ||
Object owner) | ||
throws HibernateException, SQLException { | ||
if (rs.getObject(names[0]) == null) { | ||
public T nullSafeGet(ResultSet rs, int position, SharedSessionContractImplementor session, | ||
Object owner) throws SQLException { | ||
if (rs.getObject(position) == null) { | ||
return null; | ||
} | ||
PGobject pgObject = (PGobject) rs.getObject(names[0]); | ||
PGobject pgObject = (PGobject) rs.getObject(position); | ||
try { | ||
return mapper.readValue(pgObject.getValue(), this.returnedClass()); | ||
} catch (Exception e) { | ||
throw new ReportPortalException("Failed to convert String to Invoice: " + e.getMessage(), e); | ||
throw new ReportPortalException( | ||
String.format("Failed to convert String to '%s' ", this.returnedClass().getName()), e); | ||
} | ||
} | ||
|
||
|
@@ -95,7 +92,7 @@ public void nullSafeSet(PreparedStatement st, Object value, int index, | |
} | ||
|
||
@Override | ||
public Object deepCopy(Object value) throws HibernateException { | ||
public T deepCopy(Object value) throws HibernateException { | ||
try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream( | ||
bos)) { | ||
// use serialization to create a deep copy | ||
|
@@ -104,7 +101,7 @@ public Object deepCopy(Object value) throws HibernateException { | |
oos.flush(); | ||
|
||
ByteArrayInputStream bais = new ByteArrayInputStream(bos.toByteArray()); | ||
return new ObjectInputStream(bais).readObject(); | ||
return (T) new ObjectInputStream(bais).readObject(); | ||
} catch (ClassNotFoundException | IOException ex) { | ||
throw new HibernateException(ex); | ||
} | ||
|
@@ -113,21 +110,21 @@ public Object deepCopy(Object value) throws HibernateException { | |
@Override | ||
public Serializable disassemble(Object value) throws HibernateException { | ||
Object copy = deepCopy(value); | ||
if (copy instanceof Serializable) { | ||
return (Serializable) copy; | ||
if (copy instanceof Serializable serializable) { | ||
return serializable; | ||
} | ||
throw new SerializationException( | ||
String.format("Cannot serialize '%s', %s is not Serializable.", value, value.getClass()), | ||
null); | ||
} | ||
|
||
@Override | ||
public Object assemble(Serializable cached, Object owner) throws HibernateException { | ||
public T assemble(Serializable cached, Object owner) throws HibernateException { | ||
return deepCopy(cached); | ||
} | ||
|
||
@Override | ||
public Object replace(Object original, Object target, Object owner) throws HibernateException { | ||
public T replace(Object original, Object target, Object owner) throws HibernateException { | ||
return deepCopy(original); | ||
} | ||
|
||
|
Oops, something went wrong.