Questions tagged [hibernate]

Hibernate is an object-relational mapping (ORM) library for the Java language enabling developers to utilize POJO-style domain models in their applications in ways extending well beyond Object/Relational Mapping.

Hibernate is the umbrella for a collection of , most notably Hibernate ORM which provides Object/Relational Mapping for domain objects.
In addition to its own "native" API, Hibernate ORM is also an implementation of the Java Persistence API () specification.

Related tags

Beginner's resources

Frequently asked questions

People often ask the following questions:

94278 questions
19
votes
3 answers

hibernate default connection pooling

Does Hibernate use connection pool by default? If so what is the default value for *connection.pool_size*? Doesn't it conflicts with *hibernate.connection.release_mode*? Isn't the all idea of connection pooling is not closing connections?
Adi Baron
  • 546
  • 2
  • 5
  • 21
19
votes
4 answers

Maven 3 Archetype for Project With Spring, Spring MVC, Hibernate, JPA

I'm trying to use Maven 3 to create a project which uses Spring 3, Spring MVC, Hibernate 4, and JPA. However, when I execute: mvn archetype:generate Non of the archetypes listed include all of these; and even those which are close seem to be…
user1888243
  • 2,591
  • 9
  • 32
  • 44
19
votes
1 answer

Hibernate Envers - Get Fields that have changed

I have a rather complicated DB structure that I am trying to audit. Currently I have Envers running and it audits the changes that are made to each object. This works really well! I now want to show some audit information on the UI. The…
RNJ
  • 15,272
  • 18
  • 86
  • 131
19
votes
4 answers

How to add cache feature in Spring Data JPA CRUDRepository

I want to add "Cacheable" annotation in findOne method, and evict the cache when delete or happen methods happened. How can I do that ?
virsir
  • 15,159
  • 25
  • 75
  • 109
19
votes
5 answers

Hibernate : Difference between @ Embedded annotation technique and @OneToOne annotation Technique

What is the difference between @Embedded annotation technique and @OneToOne annotation technique because in Embedded the java class contain "Has a" relationship in class and with the help of @Embedded annotation we persist the has a object in…
Harmeet Singh Taara
  • 6,483
  • 20
  • 73
  • 126
19
votes
3 answers

Doesn't work setting default value of property in Hibernate

I have a boolean property in my entity. Here's my annotations for it: @Column(name = "IS_ACTIVE", nullable = false, columnDefinition="BIT DEFAULT 1", length = 1) public Boolean getActive() { return isActive; } But columnDefinition="BIT DEFAULT…
19
votes
1 answer

Extend JPA entity to add attributes and logic

I need to know if it's possible to add some attributes and behaviours to some POJO JPA entity (using hibernate provider) by extending it, and then to make entityManager to return extended objects instead of just pojo entitys, like the following…
jmoreira
  • 1,556
  • 2
  • 16
  • 26
19
votes
3 answers

How to return a single result object from hibernate query?

Does a query execution always have to return a list ? How do I replace the code below if I am sure it will only return a single object ? @Override public List findAllByDocId(String docId) { Query q =…
Phoenix
  • 8,695
  • 16
  • 55
  • 88
19
votes
7 answers

PostGIS Geometry saving: "Invalid endian flag value encountered."

I have a Spring Roo + Hibernate project which takes a JTS well-known text (WKT) String input from the client application, converts it into a JTS Geometry object, and then attempts to write it to the PostGIS database. I had some problems with the…
orlade
  • 2,060
  • 4
  • 24
  • 35
19
votes
2 answers

Which is better performance in hibernate native query or HQL

In the server side code generally for better performance we should not use "select * from table" rather we should query the necessary column according to the need (Select name, add from employee).This i read in data base performance guidlines…
manoj s
  • 261
  • 1
  • 2
  • 5
19
votes
2 answers

Using a join in a Hibernate HQL update query

i have the following hibernate mapping: