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
1
vote
1 answer

Configured JCache with Hibernate 5.3.7 throws exception Caused by: java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException

I try to migrate Hibernate 5.3.7.Final to use EhCache 3.5.1, but it throws error about missing class net.sf.ehcache.CacheException. I understand that this library was needed for EhCache 2.x, so I have removed it. Why it still needs this class? My…
Beacze
  • 534
  • 3
  • 8
  • 24
1
vote
0 answers

JPA Changes in calling stored procedure

Is there any other way to reduce the below code snippet. Before we are using Hibernate4 current we changing to Hibernate5(Version 5.3.6.Final) so there are so many changes in Hibernate5. We are new to this version so anyone shares us any code…
Sitansu
  • 3,225
  • 8
  • 34
  • 61
1
vote
0 answers

Unable to configue ehcache with Hibernate 5.3.5 , Ehcache 3.5.2, jdk 8, wildfly 8

I am using Hibernate 5.3.5, with ehcache 3.5.2 , my hibernate.cfg.xml has the following entries true true
1
vote
0 answers

Hibernate: many to many with extra column and heritage

If someone can help me, I would be very grateful. My code does not return any errors, but when printing the JSON, the composite id mapping of the employeeproject table is empty. I do not find any problem If someone can see it. The database table…
1
vote
4 answers

Hibernate value split into 2 columns. How to map?

I got a legacy database which I want to keep as it is, but this causes some problems with hibernate. My current problem is, that I have the field private Calendar myTradeDateTime; in my POJO and this is mapped to 2 columns. The first column holds…
XtremeBaumer
  • 6,275
  • 3
  • 19
  • 65
1
vote
1 answer

Get inserted Id from NativeQuery Hibernate 5.2+

I am using the following code to run native sql queries on hibernate (SQLQuery) has been deprecated. private static int executeUpdate(String sql) { int result = 0; Session session = HibernateSessionFactory.getSession(); …
1
vote
1 answer

Hibernate schema generation on PostgreSQL: wrong column type UUID instead of INET

I rely on hibernate schema generation as part of the workflow, as the changes to the model are rather big with each commit. I use the generated schema to complete the scripts used for the testing environment. The database in use is PostgreSQL. I am…
parml
  • 497
  • 5
  • 15
1
vote
0 answers

Accessing members of associated @OneToOne entity in POST_LOAD event listener

I have two entities that look similar this: EntityA: @Entity @Getter @Setter @Table(name = "TABLE_A") public class EntityA implements SomeInterface { @Id @Column(name = "A_ID") private Long id; @OneToOne(mappedBy = "entityA") …
mitrue
  • 63
  • 6
1
vote
0 answers

Unwrap and print query to console while using CriteriaQuery in Hibernate5.x

I have migrated from Hibernate 4 to Hibernate 5.2.17 and use CriteriaQuery now as opposed to the old Criteria. While debugging, we could do the following in Hibernate4 to see how the query looks like eventually String sqlOutput =…
HopeKing
  • 3,317
  • 7
  • 39
  • 62
1
vote
0 answers

Are Hibernate's callbacks asynchronous?

I have gone through below link and implemented hibernate interceptors. http://docs.jboss.org/hibernate/orm/5.2/userguide/html_single/Hibernate_User_Guide.html#events-jpa-callbacks It is said in document @PrePersist, @PreRemove and @PostRemove are…
1
vote
1 answer

spring.jpa.hibernate.ddl-auto=create is not working in Hibernate 5 with SpringBoot 2.0

I created a SpringBoot 1.5.11.RELEASE and Hibernate 5 project. Everything was working fine. However, when I changed SpringBoot version to 2.0.0.RELEASE the spring.jpa.hibernate.ddl-auto=create does not work. I have tried this stackoverflow post,…
Mehraj Malik
  • 14,872
  • 15
  • 58
  • 85
1
vote
1 answer

Java 8, time is not being converted

I'm using Hibernate 5 & MySQL. This is what is getting saved into the database: 2018-03-11 06:26:47.336 I don't think this is 24 hour format, but then how do I see AM/PM? And how do I save the time in 24 hour format? Running SELECT…
Noman
  • 887
  • 1
  • 15
  • 34
1
vote
1 answer

Cascade.ALL in OneToManyJoin. javax.persistence.EntityExistsException: same identifier value was already associated with the session

I have a detached entity with a One-To-Many join. @Entity @Table("t1") class Entity1 implements Serializable { ... @OneToMany(cascade=CascadeType.ALL) @JoinColumns({ @JoinColumn(name="FIELD_1", insertable = false, updatable =…
500 Server error
  • 644
  • 13
  • 28
1
vote
3 answers

Exception in thread "main" java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException getting this Excdption

I am trying a simple program with hibernate but while retrieving data from db i am getting this error. But the insertion is working fine. I have provided the all the annotations properly in the Bean class. Any help will be useful. This is the Bean…
1
vote
1 answer

java.util.Date format output changes when migrating from hibernate-4 to hibernate-5

I am currently trying to update some of our current libraries, and I've hit a blocking issue. This is a legacy application, here's the basic setup: Java 8 Tomcat 7 Mysql 5.5.27-28.1-log Percona Server Spring 4.2.4.RELEASE The Relevant Hibernate…
liam
  • 3,830
  • 6
  • 32
  • 31