Questions for hibernate


6357

Hibernate Entity not being persisted

I am building a web app built on Spring MVC and Hibernate. I have an existing domain model and the application is largely working.
3496

Persisting Users using Hibernate

I've created a UserObject and RoleObject to represent users in my application. I'm trying to use hibernate for CRUD instead of raw JDBC. I've successfully retrieved the information from the data...
3579

LazyInitializationException (Spring and Vaadin) despite of OpenEntityManagerInView

I am using Spring Roo and Vaadin for a (simple) database application. There is a view displaying a Table containing entities. For the table to be displayed, Hibernate needs to lazily load 1:n refer...
6207

How do I change my XML to have hibernate to define the DataSource

can someone please show me how to change my XML to have hibernate to define the DataSource. I would like to see a good sample of it. Below is my xml file. can someone post what it would look like...
9803

Hibernate Annotation Placement Question

I've got what I think is a simple question. I've seen examples both ways. The question is - "why can't I place my annotations on the field?". Let me give you an example....
8816

GWT Cannot Serialize My Object from Hibernate

Here is the error I am receiving. I've looked everywhere for answers and I cannot figure out why anyone else isn't running into the same issue. The error happens when I'm retrieving a Proposal object
8027

Using enum vs Boolean?

This may initially seem generic, but in fact, I am actually making the decision on which I need to use.
9269

Getting error during SessionFactory creation

I keep getting failed.org.hibernate.HibernateException when I want to run my hibernate code. I'm using Spring 3 MVC and Spring 3 security in my app.
737

Hibernate/GORM - Handling multi-session domain object updating

I'm curious about best practice when it comes to updating a domain object that may be updated by multiple sessions.
6892

Hibernate: mapping many-to-many to Map

I am developing an application which deals with two following entities: Products (let's name it as X, Y, Z) and Materials (a, b, c, ...). It's known that every product has a recipe which indicates ...
9596

Hibernate Bidirectional Many to Many implementation

I am new to hibernate and I want to implement something like this in hibernate. To be able to do this, I am getting problem in setting the xml mapping file. If someone can help me, it would be very...
7303

SQl Query to Hibernate Query

I have a MYSQL query that I use to retrieve random rows from a table. The query is :
4756

How to use regular expressions with Hibernate/Oracle

I'm trying to implement a web service which accepts a list of strings, each of which is a regular expression. These need to be compared against six columns of a database, and any rows which match ...
4221

Hibernate Error in GWT

I am getting a hibernate error. I am just doing a proof of concept to test for association in hibernate. I am almost sure that the error i think lies in the mapping file but i cannot figure it
3959

Conditional/composite JoinColumn In JPA/Hibernate

In one of my classes, say Location, I have something like this:
8987

specify db password in ant build file

my webapp has a hibernate config file that specifies db password as follows:
5382

Hibernate mapping error - Unknown entity

I'm a hibernate newbie and im receiving this error when trying to persist an object -
1265

java.io.IOException: Premature EOF in REST in java using jersey

I implement a RESTful Web Service in Java using jersey and run it on Tomcat7.
7418

Optimizing data inserts for HibernateTemplate

I have to optimize the database (especially insert) performance of a certain legacy tool. The tool has been written in Java and for the data access layer Spring + HibernateTemplate was the technolo...
8181
3418

java.lang.NullPointerException at org.hibernate.hql.ast.HqlParser.negateNode

I'm currently working on a Java EE project which uses JPA. I'm connecting to a InnuDB MySQL DB and after having some problems with some entities relations (ManyToMany) I changed some of the Collec...
9772

Hibernate, return custom object with Criteria or HQL

there is a way to return a custom object with a criteria query or hql query?
3595

JPA Multiple Entity with Collection Query

I have the following in SQL:
2648

Mapping a set in Hibernate with a composite primary key

For reasons related to DB replication, I need all the tables in my DB to have primary keys.
7293

Using Hibernate to migrate data

Developing a brand new schema/app which uses hibernate to create tables from pojo's.
3208

Spring MVC-Hibernate error: BasicDataSource is not found

I created a spring mvc project using Spring Roo, with MySql database and Hibernate provider. The problem is that when I run it I get the following error:
9503

LONG as primary key in Hibernate mapping to MySQL

I am trying to implement persistence of some Java objects via Hibernate mapping to a MySQL table. When I commit I get a message saying 'Batch update returned unexpected row count from update [0]; a...
1317

Grails sequence generation for Oracle 11g

I realize this is more of a hibernate question than Grails. In a load balanced (2 nodes) environment I see that the ids of my objects are jumping around quite a bit. Even without restarting the app
1243

Spring + Hibernate confuguration

I am trying to integrate Spring and Hibernate but when I run the code and submit my for then it throws this exception
243

Is it not a good practice to have logic in dao side?

I have entity A and A has set of entity B. I do lazy loading. When I load all of the A results list I need to have a transient value for each A that has the size of B for that A.
3293

JPA2 (Hibernate) how to query 2 tables (joined) but only need certains properties from 2nd table

I am using JPA2 with hibernate as provider in java ee6 environment.
2690

JProfiler shows “unknown” JDBC calls take 40% of the time

I am using JProfiler to view all the JDBC calls in my application that's using Hibernate. It turns out that the top 2 hot spots are "unknown" and "select 1". Any ideas what they are?
7105

HibernateTransactionManager or JpaTransactionManager

Developing application with friend, but ran into a question...
6787

Errors while iterate over a List of objects in hibernate +Java?

I need to iterate and manipulate the list with my corresponding getters and setters. I tried the following based on the forum answer Retrieving Hibernate query result as result set instead of list
259

Hibernate and MySQL, Importing stored procedure

What's the proper way of importing/declaring stored procedure in Hibernate.
8923

EmbeddedId, sequence and ConstraintViolationException

I've got entity, which has @EmbeddedId. In the id class there are a few fields, and one of them is Long id with Generation type sequence. Problem apperas when I'm trying to insert instance of this
5195

JPA 2.0 orphanRemoval=true VS on delete Cascade

I am a little confused about the JPA 2.0 orphanRemoval attribute.
2098

grails / GORM / hibernate - hasMany map not synchronised on save() of parent

Problem deleting associated entities and having this change persisted to the database.
4789

Hibernate Not Loading Postgresql bytea consistently

I am using Hibernate 3.6 on two different boxes, both reading from exactly the same database table. The Hibernate annotation for two fields is as such:
775

Hibernate: Parse/Translate HQL FROM part to get pairs class alias, class name

Can anyone point me out, how can I parse/evaluate HQL and get map where key is table alias and value - full qualified class name.
3940

Configure pom.xml for hibernate 3.6

I tried to conigure pom.xml file for my Spring 3 & Hibernate 3.6 application.
2323

Front end technology / framework

I am using Spring MVC and Hibernate for a project. I am little confused about which technology to use in front end part(in jsp part), to get better look and fill as well which is easy to adopt.
8102

Get Dialect within some class inside Spring MVC + Hibernate application

I have Hibernate Transaction manager configured inside Spring MVC controller.
4157

How to update Hibernate delivered with Play?

Play frameworks comes with an old Hibernate version (3.6.1). How can I update Hibernate in my Play application? Via Ivy?
8110

Need an example of a primary-key @OneToOne mapping in Hibernate

Can somebody please give me an example of a unidirectional @OneToOne primary-key mapping in Hibernate ? I've tried numerous combinations, and so far the best thing I've gotten is this :
8232

Prepared statements, hibernate and HQL

Hibernate internally uses PreparedStatements under JDBC when converting HQL to SQL. How are inline parameters within an HQL handled ?
1765

Is there a Java user management package similar to Django auth application?

I'm looking for a java package/spring user management package that is similar to django's auth application, which provides the database models such as User and Group out-of-the-box.
442

“Session closed” error when trying to get a blob from DB using getBinaryStream()

I'm using Hibernate 3.1 and Oracle 10 DB. The blob is defined as @Lob @Basic @Column in the Hibernate entity which corresponds to the relevant DB table.
2129

Can an entity have more than one many-to-many relations?

I have a table that has two different many-to-many relations to two different tables. Let's say I have User <---> UserRole <--> Role and User <--> UserGroups <--> Groups. Since I am new...

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.