Questions for hibernate


Using Hibernate with a map for the attributes of a table

So I have some code that represents a songs metadata, instead of having getters and setters for each field I put the values in map, each field is a String, and I have a seperate enum for each field...

Hibernate: Multiple FK relationships

I'm kinda stuck defining a Hibernate Entity:

Hibernate basic configuration in Spring 3 project - Class not found exception

I'm trying to set up Hibernate 3.6 in my existing Spring 3 MVC + Spring 3 security project. Nevertheless I keep getting java.lang.ClassNotFoundException in my HibernateUtil class - line with return...

How can I configure Hibernate with environment variable

So i want to deploy my java app on heroku. Once deployed it sets an environment variable DATABASE_URL. I want to use that as my url for hibernate. I currently have hibernate.cfg.xml and there i set...

Performance difference between annotating fields or getter methods in Hibernate / JPA

I was curious if anyone had any hard numbers around the performance difference between annotating Entities using private fields instead of public getter methods. I've heard people say that fields ...

HQL Join - Path expected for join! hibernate

I am new to hibernate and I met a following problem:

Retrieving a list of objects with null in the properties after applying resultTransformer

In a criteria query I am getting a list of results in a right way.

JPA Multiple Embedded fields

Is it possible for a JPA entity class to contain two embedded (@Embedded) fields? An example would be:

Accessing Hibernate Session from EJB using EntityManager

Is it possible to obtain the Hibernate Session object from the EntityManager? I want to access some hibernate specific API...

Turning off hibernate logging console output

I'm using hibernate 3 and want to stop it from dumping all the startup messages to the console. I tried commenting out the stdout lines in but no luck. I've pasted my log file below.

WARN (org.hibernate.jdbc.JDBCContext:333) - afterTransactionCompletion() was never called

I am using hibernate as ORM when i checked my logs (catalina.out)

Hibernate and transactions and table locking

If I have code that looks like the following:

Need clarification about mapping objects to database, annotations, and one to many relationships

Need some help understanding if I'm on the right track here and exactly what I need to do. Hope someone can chime in.

Hibernate cannot simultaneously fetch multiple bags

Hibernate throws this exception during SessionFactory creation:

Grails: selecting Children of Parent of Child with given id (subquery) with a Where Query

Using grails 2.1.0 and default H2 database. I've got the following domains:

Hibernate group by time interval

I have a table with a timestamp field of type datetime. I need to aggregate the data between a defined start and end time into x groups representing time intervals of equal length, where x is suppl...

JPA OneToMany and Getting children with a single query

I notice that in hibernate, it queries the child collections of entities an entity at a time. So, for example, I have a Person entity with a OneToMany relationship with PhoneNumber as well as a One...

Workaround for Hibernate relationships and SmartGWT RESTDataSources

I'm lost with the way I have to implement a ManyToMany relationship defined in Hibernate. In the client-side we're using SmartGWT LGPL version with RESTDataSources working fine against some back-end

How to configure “hibernate-mapping” to “field”

I want to specify via standard JPA Persistence.createEntityManagerFactory(String,Map<String,String>) to hibernate to use "hibernate-mapping" to "field" rather than "property".

Hibernate 2.1.6 or 3.x?

We are in the process of revamping our persistence layer from some proprietary orm. Most of our developers are already familiar with hibernate 2 and also its gotchas. So we decided to stay with Hib...

Join an image into POJO on the server and then persisting using Hibernate?

in a question(here Placing an image in an object, sending the object over rpc and then using hibernate ), someone told me

Hibernate get old / new for audit log

I want to log the changes of some entities.

What are First and Second Level caching in Hibernate?

Can anyone explain in simple words what First and Second Level caching in Hibernate are?

Updating clob column in oracle with CLOB value

i want to update a column is CLOB type, the method is below;

How do I get the Hibernate Configuration after the EntityManagerFactory has been built?

My web framework (Play 1.2.5) creates an EJB3Configuration local to a method which it uses to create an EntityManagerFactory (source). I am working on a script and would like to run the

Still no luck with C3P0 pooling in Hibernate using Spring WebFlow

Still no luck with C3P0 pooling in Hibernate using Spring WebFlow if I use the following database.xml file and run my project I check the database and I only see two connects to it but I have it se...

Class not eligible for getting processed by all BeanPostProcessors

I'm having a lot of trouble to set up a configuration of Spring + Spring Data JPA + QueryDSL + JPA 2.0 + Hibernate in Maven. I already solved a lot of problems, but this one is giving me headache =...

Hibernate Index Query Slow

My question is similar to the one posed in this thread:

Hibernate and Oracle native functions

I have an entity that maps to an external oracle table which is one of the primary data sources of my application. This entity is modelled using hibernate.

IUserType to default UTC Timestamp not persisting value

I built an IUserType class to default a UTC creation timestamp on a record. I thought I implemented it correctly, but it persists nothing to the database. Can someone tell me what I am doing wron...

Query in Hibernate

I am using hibernate to map the data to my mysql database in a Restful Web Service(using jersey).

What's wrong with creating sequence id hibernate generator?

I want to use sequence id generator,that will work in all databases.So i was seacrhing for an answer and found that blog and according to this next snippet must work:

IJ000453: Unable to get managed connection datasources

17:03:38,942 WARN [org.hibernate.engine.jdbc.internal.JdbcServicesImpl] (MSC service thread 1-2) HHH000342: Could not obtain connection to query metadata : javax.resource.ResourceException: IJ0004...

JPA/Hibernate - shared primary key

I wanted to create bidirectional one to one relationship with shared primary key.

how to ignore fetching a child table in hibernate

i have two tables . health & Network

Hibernate configuration file

It seems that I have a problem with my configuration file but I really don't find out what it could be.

Setup/tear down Oracle schema for CI build without fragmenting catalog

I would like to have a CI build (e.g., Hudson) set up and tear down an Oracle 11g schema as part of a nightly build/test cycle for a fairly vanilla JSF/JPA application.

Best practice for working with Foreign key fields

I have 2 tables, Word and State,

How loose coupling DB interaction when using ORM

I am really struggling with understanding how you are loose coupling your app with a DB when you use an ORM. I understand there are code first and data first design patterns and in some scnearios

Enums in NHibernate from Existing Table

I have many tables in my schema design (legacy, cannot be changed) with the pattern:

Reasons to change JPA implementation?

I've heard that some people during their careers have changed the JPA implementation in their projects, but what are the reasons?

JPA/Hibernate in Java SE 6, Best Practices for data access

I am starting a normal Java SE project and i am planning to use JPA/Hibernate. I was wondering if anyone could enlighten me as to what is considered the best way to interact with Hibernate in this

Weird problem with Spring MVC, Bean Validation using @Valid and Hibernate

I have an application uses bean validation in 50 domain classes. It has worked for months without any problems using @Valid in the Spring MVC controllers.

How do I maintain consistency of cached ManyToOne collections with READ_WRITE CacheConcurrencyStrategy in Hibernate?

I'm running into a difference between NONSTRICT_READ_WRITE and READ_WRITE CacheConcurrencyStrategy when writing "denormalized" collections... the idea being that I have a join table modeled as an e...

Spring - inner methods called by @Transactional(readOnly = true) method to write

If a method has annotation @Transactional(readOnly = true), is there a way to allow inner methods to write?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.