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
2
votes
0 answers

SQL Server and Hibernate - datetime2 vs varbinary

Hibernate saves the older Java Date objects as a datetime2(7) in SQL Server, and Hibernate saves the newer Java LocalDateTime objects as varbinary(255) in SQL Server. Are there any issues with performance, for instance searching greater than/equal…
Anonymous1
  • 3,877
  • 3
  • 28
  • 42
2
votes
2 answers

Hibernate: how to select last N rows in ascending order of id? (in single query)

Hibernate version: 5.2 I am trying to use subqueries to do, and use setMaxResults(int). session.createQuery( "FROM ( SELECT * FROM tickets ORDER BY id DESC limit 3) sub ORDER BY id ASC" ); However, HQL subqueries can occur only in the select or…
Pika
  • 507
  • 1
  • 6
  • 16
2
votes
2 answers

JPA/Hibernate cascade remove not working

I have these entities: @Entity public class Item extends Unit { // @Id is in superclass @OneToMany(mappedBy = "parent", cascade = CascadeType.ALL, orphanRemoval = true) private Set lowerItemRelations = new…
Michele Mariotti
  • 7,372
  • 5
  • 41
  • 73
2
votes
1 answer

Hibernate 5.x delete record based on partial composite id?

I have an embedded composite key that consist of two column @Embeddable public static class PK implements Serializable { private static final long serialVersionUID = 4049628068378058196L; @Column(name="colA", length=32, nullable=false) …
Micho Rizo
  • 1,000
  • 3
  • 12
  • 27
2
votes
1 answer

Hibernate 5 entity listeners with Guice

I'm playing with the new Hibernate 5 Bootstrap API and was excited to see how easily (compared to previous/legacy API) can assemble SessionFactory and family. Now, I would like to provide my own ListenerFactory which basically delegates creation and…
Edgar Espina
  • 507
  • 4
  • 10
2
votes
1 answer

configure spring4 with hibernate5

I try configure spring version 4.3.1 with hibernate 5 but i have got error when try to create entity manager factory. My hibernate version 5.0.9.Final" hibernate validator version "5.2.4.Final" My dependencies hibernate-core 5.0.9.Final…
2
votes
0 answers

How to generate domain from an enum while generating DDL from data model?

Is there a way to generate a domain for a field that is defined as enum while generating DDL from the data model? The default behaviour for fields that are defined as enum is either EnumType.STRING or EnumType.ORDINAL. In this particular case I use…
Jagger
  • 10,350
  • 9
  • 51
  • 93
2
votes
1 answer

Migrating to Hibernate 5.2 is giving error Caused by: org.hibernate.HibernateException: Could not determine a type for class: java.util.Collection

I am using spring project. Here is my POM snippet ..... org.springframework.data spring-data-jpa
Basit
  • 8,426
  • 46
  • 116
  • 196
2
votes
1 answer

Hibernate and Postgres : function st_buffer(bytea, numeric) is not unique

I'm working with Hibernate 5.1.0 in a Java application. I'm connecting both to a Postgres 9.5 with Postgis extensions and Oracle databases. I need to find all the geometries in my database that intersect with a given geometry to which I apply a…
krause
  • 436
  • 5
  • 24
2
votes
1 answer

When do I need hibernate runtime proxy generation?

The hibernate documentation says: "the constructor should be defined with at least package visibility if you wish to leverage runtime proxy generation". I've read in the hibernate documentation, that hibernate can enhance bytecode instead of proxy…
user1552545
  • 1,233
  • 3
  • 15
  • 33
2
votes
2 answers

Hibernate 5.1.0 Errors Unable to perform unmarshalling and Cannot find the declaration of element 'hibernate-configuration'

Trying to create a simple student database with a single entry in it. I am using Hibernate 5.1.0 and MySql as database with simple student table, and cannot connect to the database. Using Eclipse Mars and also MYSQL jdbc driver added to the project…
nitishpisal
  • 143
  • 1
  • 2
  • 9
2
votes
1 answer

Hibernate ORM: Saving Parent Entity Saves the Children too?

I have the below JSON as input: { "type": "Student", "numOfPeople": "1", "tenantMembers": [ { "firstName": "Chris", "lastName": "C" } ], "tenantDetails": { "firstName": "John", "lastName": "J", "email"…
kukkuz
  • 41,512
  • 6
  • 59
  • 95
2
votes
1 answer

Starting up Hibernate 5 with jboss 7

I am facing a problem while using Hibernate 5.1.0 on JBoss 7.1.1-Final. It seems like it's related to the logging classes. Here it is my build.gradle file apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'war' targetCompatibility =…
kekolab
  • 801
  • 10
  • 24
2
votes
1 answer

Getting "Another unnamed CacheManager already exists" error when running Hibernate 5 with my Junit 4 tests

I recently upgraded to Hibernate 5.1.0.Final (with accompanying ehache) and am using Spring 3.2.11.RELEASE. Despite following the advice here -- Another unnamed CacheManager already exists in the same VM (ehCache 2.5), I'm seeing an error when…
Dave
  • 15,639
  • 133
  • 442
  • 830
2
votes
1 answer

Grails: ERROR org.springframework.boot.SpringApplication - Application startup failed

I want to set Hibernate5 plugin to my grails application, I use grails 3.1.1. I checked already this question and I followed it: How to configure Grails 3.1.1 to use Hibernate 5 However I am getting the following error: ERROR…
Ectoras
  • 1,297
  • 3
  • 13
  • 33