Questions tagged [hibernate-5.x]

Hibernate-the object-relational mapping framework for the Java language released new version 5.x with enhanced features like query parser,multi-tenancy improvements,follow-on fetches,OSGi improvements etc.

Hibernate-the object-relational mapping framework for the Java language released new version 5.x with enhanced features like query parser,multi-tenancy improvements,follow-on fetches,OSGi improvements etc.

For more details on Hibernate version 5.x view Hibernate ORM Roadmap

368 questions
4
votes
3 answers

Migrating to Hibernate 5

I am migrating an application from Hibernate 4.3 to Hibernate 5.0.1-Final I use ImplicitNamingStrategyComponentPathImpl as my hibernate.implicit_naming_strategy with Postgres 9.4.4 and my company uses hibernate.hbm2ddl.auto = update for deployment (…
ShellDragon
  • 1,712
  • 2
  • 12
  • 24
4
votes
2 answers

Spring data Jpa findTop and findFirst generating error Incorrect syntax near '@P0'

I am using spring data JPA 1.8.2 and trying to get top result. I am using the following method LearningSession findTopBySourceAndExternalLmsSessionIdAndCourseCodeAndLearnerEnrollmentEnrollmentStatusOrderByIdAsc(String source, String…
Basit
  • 8,426
  • 46
  • 116
  • 196
4
votes
2 answers

Hibernate 5 + Java 8 LocalDateTime

After a lot of reading and trying solutions from around the web, I've decided to ask for help because none of the solutions tried worked for me. I have a very simple class which has a LocalDateTime variable. I have created a MySQL table where I…
Asaak
  • 477
  • 1
  • 6
  • 15
3
votes
1 answer

Upgrading to Hibernate 5: how to get type mapping now that TypeResolver is deprecated

I'm working with an older codebase which has a LOT of entities using enums like this (currently using Hibernate 3), with a "generifying" GenericEnumUserType class: @Entity @Table(name = "dog") @TypeDefs({ @TypeDef(name = "DogEnumType", …
Vlad L
  • 1,544
  • 3
  • 6
  • 20
3
votes
0 answers

How to prevent JPA/Hibernate attempts to delete from (read-only) DB view mapped Map property?

I have something like this: @ElementCollection(fetch = FetchType.LAZY) @CollectionTable(name = "my_read_only_view", joinColumns = {@JoinColumn(name = "entity_id", referencedColumnName = "id", updatable = false, insertable = false)}) …
Learner
  • 1,215
  • 1
  • 11
  • 26
3
votes
0 answers

setMaxResult(0) returning an empty List in hibernate 5.2.6+ but which was not the case in prior versions

I am migrating the hibernate version from 5.0.12.Final to 5.4.28.Final and I had performed some obvious straightforward deprecated changes like changing org.hibernate.Query to org.hibernate.query.Query, but encountered the following breaking…
Prasanth Rajendran
  • 4,570
  • 2
  • 42
  • 59
3
votes
1 answer

Spring Boot Hibernate not picking up use-new-id-generator-mappings property

I'm upgrading my project to Spring Boot 2.1.18 that uses Hibernate 5.3.18. Previously, my entity looked like thus and would use the SequenceHiLoGenerator: @Entity @Table(name = "group_link") @SequenceGenerator(name = "group_link_seq", sequenceName =…
AHungerArtist
  • 9,332
  • 17
  • 73
  • 109
3
votes
1 answer

invalidDataAccessApiUsageException - OUT/INOUT Parameter is not available. Upgrading from springboot 1.5.7 to 2.1.6 and hibernate 5.3

I am in process of upgrading my project from springboot 1.5.7 to 2.1.6 , everything looks good after some modifications and correcting compile errors. when i try some test case for saving object and to return one column using @procedure, I see below…
Hari
  • 37
  • 2
  • 8
3
votes
1 answer

Migrating to hibernate 5.1.16 from hibernate 4.3 have QuerySyntaxException

I'm trying to migrate my hibernate 4.3 to hibernate 5.1.16 and I am ending up with QuerySyntaxException which am not able to figure after one week. I am using annotation for mapping and I checked my queries all of those uses the same name of my…
Lilac
  • 580
  • 1
  • 7
  • 25
3
votes
0 answers

WARN:Could not find a specific ehcache configuration for cache named message in Hibernate

Getting the warning message when deploying the application in server Jboss eap 7.1 - while starting the server below messages are shown in eclipse console log as like below, WARN [org.hibernate.cache.ehcache.AbstractEhcacheRegionFactory]…
Siva
  • 43
  • 1
  • 2
  • 8
3
votes
1 answer

Fetching a lazy OneToOne entity fetches every other OneToOne entities within the same object

Using Entity entity = hibernateTemplate.get(Entity.class, id); when I hit a entity.getChild() which is a OneToOne relation, every other OneToOne relations are loaded as well. I use hibernate 5.4.1-Final. I use bytecode enhancement as below…
3
votes
1 answer

Getting all pending requests one to many mappings

I have two tables (requests and requests_details) like as shown below. requests table have request_id and request name and requests_details have the details whether the request is in pending, approved or rejected. I have implemented the below two…
Alex Man
  • 4,746
  • 17
  • 93
  • 178
3
votes
1 answer

Confusion about EntityManagerFactory and SessionFactory with Hibernate 5.3, Spring Data JPA 2.1.4 and Spring 5.1

I tried to figure out the new mechanism for integrating Hibernate and Spring Data JPA. I followed the example provided on https://www.baeldung.com/hibernate-5-spring but to no avail. Further research brought me an issue on Github by Juergen Hoeller…
3
votes
1 answer

Hibernate update, PropertyAccessor, ChainedPropertyAccessor, PropertyAccessorFactory no longer available in version 5.3.7

I do a migration to Hibernate 5.3.7. I'm having the following snippet of code that I have an issue with during migration. PropertyAccessor propertyAccessor = new ChainedPropertyAccessor(new PropertyAccessor[] { …
Piotr
  • 45
  • 4
3
votes
2 answers

Hibernate 5 and Spring Boot 2 - AttributeConverter class registered multiple times

In my Spring Boot application I have a simple JPA AttributeConverter declared like: @Converter(autoApply = true) public class GenderConverter implements AttributeConverter {...} and applied like: @Entity public class User { …
naXa stands with Ukraine
  • 35,493
  • 19
  • 190
  • 259