Skip to content

Commit

Permalink
upgrading hibernate dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Jun 8, 2021
1 parent d1be44f commit 1dc5959
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 21 deletions.
23 changes: 18 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<artifactId>spring-boot-dependencies</artifactId>
<version>2.5.0</version>
<!-- This parent also declares dependencies listed here:
https://docs.spring.io/spring-boot/docs/2.4.3/reference/html/appendix-dependency-versions.html
https://docs.spring.io/spring-boot/docs/2.5.0/reference/html/dependency-versions.html#dependency-versions
Or for current version of Spring Boot:
https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-dependency-versions.html
-->
Expand Down Expand Up @@ -185,7 +185,7 @@
<!-- We can't upgrade to 5.3+ unless we get rid of EntityRegionAccessStrategy -->
<!-- TODO upgrade to newest 5.2.x, at least 5.2.18, see https://mvnrepository.com/artifact/org.hibernate/hibernate-core
probably not above 5.2 to avoid breaking code changes -->
<hibernate.version>5.2.12.Final</hibernate.version>
<hibernate.version>5.5.0.Final</hibernate.version>
<!--
Default Spring Boot 2.4.3 uses H2 1.4.200 but that one has NPE bug:
https://github.com/h2database/h2database/issues/1808
Expand Down Expand Up @@ -226,6 +226,7 @@
<bouncycastle.version>1.64</bouncycastle.version>
<protobuf.version>3.12.2</protobuf.version>
<graalvm.version>21.1.0</graalvm.version>
<javax.persistence.version>2.2</javax.persistence.version>

<!--
Coming in different versions from org.glassfish.jaxb:xsom and from
Expand Down Expand Up @@ -378,12 +379,24 @@
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.activation</groupId>
<artifactId>javax.activation-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</exclusion>
<exclusion>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>${javax.persistence.version}</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
Expand Down
4 changes: 2 additions & 2 deletions repo/repo-sql-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@
<artifactId>hibernate-core</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
</dependency>

<!-- H2 -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
package com.evolveum.midpoint.repo.sql.util;

import org.hibernate.HibernateException;
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy;
import org.hibernate.cache.spi.access.NaturalIdRegionAccessStrategy;
import org.hibernate.cache.spi.access.EntityDataAccess;
import org.hibernate.cache.spi.access.NaturalIdDataAccess;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.persister.entity.JoinedSubclassEntityPersister;
Expand All @@ -27,16 +27,16 @@
*/
public class MidPointJoinedPersister extends JoinedSubclassEntityPersister {

public MidPointJoinedPersister(PersistentClass persistentClass, EntityRegionAccessStrategy cacheAccessStrategy,
NaturalIdRegionAccessStrategy naturalIdRegionAccessStrategy,
PersisterCreationContext creationContext) throws HibernateException {
public MidPointJoinedPersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy,
NaturalIdDataAccess naturalIdRegionAccessStrategy,
PersisterCreationContext creationContext) throws HibernateException {
super(persistentClass, cacheAccessStrategy, naturalIdRegionAccessStrategy, creationContext);
}

@Override
public Object[] hydrate(ResultSet rs, Serializable id, Object object, Loadable rootLoadable,
String[][] suffixedPropertyColumns, boolean allProperties,
SharedSessionContractImplementor session) throws SQLException, HibernateException {
String[][] suffixedPropertyColumns, boolean allProperties,
SharedSessionContractImplementor session) throws SQLException, HibernateException {

Object[] values = super.hydrate(rs, id, object, rootLoadable, suffixedPropertyColumns, allProperties, session);
MidpointPersisterUtil.killUnwantedAssociationValues(getPropertyNames(), getPropertyTypes(), values);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
package com.evolveum.midpoint.repo.sql.util;

import org.hibernate.HibernateException;
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy;
import org.hibernate.cache.spi.access.NaturalIdRegionAccessStrategy;
import org.hibernate.cache.spi.access.EntityDataAccess;
import org.hibernate.cache.spi.access.NaturalIdDataAccess;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.persister.entity.Loadable;
Expand All @@ -27,16 +27,16 @@
*/
public class MidPointSingleTablePersister extends SingleTableEntityPersister {

public MidPointSingleTablePersister(PersistentClass persistentClass, EntityRegionAccessStrategy cacheAccessStrategy,
NaturalIdRegionAccessStrategy naturalIdRegionAccessStrategy,
PersisterCreationContext creationContext) throws HibernateException {
public MidPointSingleTablePersister(PersistentClass persistentClass, EntityDataAccess cacheAccessStrategy,
NaturalIdDataAccess naturalIdRegionAccessStrategy,
PersisterCreationContext creationContext) throws HibernateException {
super(persistentClass, cacheAccessStrategy, naturalIdRegionAccessStrategy, creationContext);
}

@Override
public Object[] hydrate(ResultSet rs, Serializable id, Object object, Loadable rootLoadable,
String[][] suffixedPropertyColumns, boolean allProperties,
SharedSessionContractImplementor session) throws SQLException, HibernateException {
String[][] suffixedPropertyColumns, boolean allProperties,
SharedSessionContractImplementor session) throws SQLException, HibernateException {

Object[] values = super.hydrate(rs, id, object, rootLoadable, suffixedPropertyColumns, allProperties, session);
MidpointPersisterUtil.killUnwantedAssociationValues(getPropertyNames(), getPropertyTypes(), values);
Expand Down

0 comments on commit 1dc5959

Please sign in to comment.