Hibernate 6 movement with dropwizard 2#144
Hibernate 6 movement with dropwizard 2#144AshayKing wants to merge 8 commits intosantanusinha:hibernate6from
Conversation
.../java/io/appform/dropwizard/sharding/dao/operations/lookupdao/GetByLookupKeyByQuerySpec.java
Outdated
Show resolved
Hide resolved
.../java/io/appform/dropwizard/sharding/dao/operations/lookupdao/GetByLookupKeyByQuerySpec.java
Outdated
Show resolved
Hide resolved
| import java.math.BigDecimal; | ||
|
|
||
| @Converter | ||
| public class BigDecimalAttributeConverter implements AttributeConverter<BigDecimal, BigDecimal> { |
There was a problem hiding this comment.
@AshayKing Is this needed ? Check if any converter is needed.
There was a problem hiding this comment.
@typedefs @TypaDef annotation support removed..hence added this cases (mainly used for Encryption use case)
src/test/java/io/appform/dropwizard/sharding/dao/testdata/entities/TestEncryptedEntity.java - added needed code changes details here
|
|
||
| @Data | ||
| @Builder | ||
| public class GetByLookupKey<T, R> extends OpContext<R> { |
There was a problem hiding this comment.
What was the reason to make this change @ashay ?
...a/io/appform/dropwizard/sharding/dao/operations/relationaldao/CreateOrUpdateByQuerySpec.java
Outdated
Show resolved
Hide resolved
src/main/java/io/appform/dropwizard/sharding/dao/operations/OpContext.java
Outdated
Show resolved
Hide resolved
src/main/java/io/appform/dropwizard/sharding/dao/LookupDao.java
Outdated
Show resolved
Hide resolved
pom.xml
Outdated
| <groupId>io.appform.dropwizard.sharding</groupId> | ||
| <artifactId>db-sharding-bundle</artifactId> | ||
| <version>2.1.12-1</version> | ||
| <version>2.1.12-1-HIBERNATE6</version> |
There was a problem hiding this comment.
@r0goyal please suggest on naming convention of release version..will update accordingly
There was a problem hiding this comment.
Let's use this 2.1.12-HIBERNATE6-RC0
| @@ -43,18 +42,6 @@ protected Session currentSession() { | |||
| return sessionFactory.getCurrentSession(); | |||
| } | |||
|
|
|||
There was a problem hiding this comment.
This class was copied from dropwizard hibernate package into this repo. Let's check dropwizard-hibernate module for 5.x and see if anything else should be added/removed from here
There was a problem hiding this comment.
No major changes apart from import changes + movement from Serilizable to Object for id lookup
| return query.executeUpdate(); | ||
| } | ||
|
|
||
| public QuerySpec<T, T> getQuerySpec(final Object key) { |
There was a problem hiding this comment.
Does this method require public visibility ?
There was a problem hiding this comment.
removed...not needed
| configuration.setProperty(AvailableSettings.USE_SQL_COMMENTS, Boolean.toString(dbConfig.isAutoCommentsEnabled())); | ||
| configuration.setProperty(AvailableSettings.USE_GET_GENERATED_KEYS, "true"); | ||
| configuration.setProperty(AvailableSettings.GENERATE_STATISTICS, "true"); | ||
| configuration.setProperty(AvailableSettings.USE_REFLECTION_OPTIMIZER, "true"); |
There was a problem hiding this comment.
Why is this removed ? Is this now set by default ?
There was a problem hiding this comment.
Byte Buddy Default: Hibernate 6 has fully transitioned to Byte Buddy as its primary bytecode provider. This engine is highly optimized out of the box, making the manual "reflection optimizer" toggle obsolete.
They have made default as part of optimisation
| configuration.setProperty(AvailableSettings.USE_REFLECTION_OPTIMIZER, "true"); | ||
| configuration.setProperty(AvailableSettings.ORDER_UPDATES, "true"); | ||
| configuration.setProperty(AvailableSettings.ORDER_INSERTS, "true"); | ||
| configuration.setProperty(AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "true"); |
There was a problem hiding this comment.
What's the implication of removing these properties ?
| * @see Session#saveOrUpdate(Object) | ||
| */ | ||
| protected E persist(E entity) throws HibernateException { | ||
| currentSession().saveOrUpdate(requireNonNull(entity)); |
There was a problem hiding this comment.
this is deprecated in h6...either merge/persist needed to be used (multiple cases failing due to this)
No description provided.