Skip to main content
Filter by
Sorted by
Tagged with
2 votes
3 answers
328 views

I have a Java program that uses Hibernate and MySQL to store a lot of tracing data about the use of the Eclipse IDE. This data contains a lot of strings such as method names, directories, perspective ...
Uri's user avatar
  • 90.1k
3 votes
2 answers
2k views

There is a UNIQUE database constraint on an index which doesn't allow more than one record having identical columns. There is a piece of code, managed by Hibernate (v2.1.8), doing two DAO ...
mindas's user avatar
  • 26.8k
2 votes
6 answers
1k views

I know this is a subjective question, but why does Hibernate seem to be designed for short lived sessions? Generally in my apps I create DAOs to abstract my data layer, but since I can't predict how ...
Allain Lalonde's user avatar
7 votes
6 answers
23k views

Right now I'm making an extremely simple website- about 5 pages. Question is if it's overkill and worth the time to integrate some sort of database mapping solution or if it would be better to just ...
GBa's user avatar
  • 18.6k
8 votes
5 answers
14k views

I have been given a requirement where I need to support multiple databases in the same instance, to support multi-tenancy. Each DB has an identical schema. The user logs into a specific database by ...
Verdant's user avatar
  • 403
6 votes
5 answers
3k views

When calling a remote service (e.g. over RMI) to load a list of entities from a database using Hibernate, how do you manage it to initialize all the fields and references the client needs? Example: ...
cretzel's user avatar
  • 20.2k
4 votes
2 answers
5k views

According to what I have found so far, I can use the following code: LocalSessionFactoryBean sessionFactory = (LocalSessionFactoryBean)super.getApplicationContext().getBean("&sessionFactory"); ...
SamS's user avatar
  • 1,591
5 votes
2 answers
6k views

I've got an application that uses a hibernate(annotations)/mysql combination for ORM. In that application, I got an entity with a Date field. I'm looking for a way to select on that date within a time ...
Linor's user avatar
  • 1,860
2 votes
4 answers
2k views

I'm writing a report view of an audit trail, and I need to display this in a .jsp. What's the "best" way to get the data from the database to the screen? We're using Spring for dependency injection, ...
ScArcher2's user avatar
  • 87.5k
13 votes
1 answer
9k views

Is it possible to bypass @GeneratedValue for an ID in Hibernate, we have a case where, most of the time we want the ID to be set using GeneratedValue, but in certain cases would like to set the ID ...
Matthew Watson's user avatar
12 votes
6 answers
10k views

is there a solution for batch insert via hibernate in partitioned postgresql table? currently i'm getting an error like this... ERROR org.hibernate.jdbc.AbstractBatcher - Exception executing batch: ...
tropikalista's user avatar
  • 1,639
2 votes
8 answers
711 views

I've got a webapp whose original code base was developed with a hand crafted hibernate mapping file. Since then, I've become fairly proficient at 'coding' my hbm.xml file. But all the cool kids are ...
Stu Thompson's user avatar
1 vote
3 answers
2k views

The situation is this: You have a Hibernate context with an object graph that has some lazy loading defined. You want to use the Hibernate objects in your UI as is without having to copy the data ...
Peter Kelley's user avatar
  • 2,360
15 votes
3 answers
10k views

Is there a way to use sql-server like analytic functions in Hibernate? Something like select foo from Foo foo where f.x = max(f.x) over (partition by f.y)
ncgz's user avatar
  • 269
32 votes
8 answers
30k views

With Hibernate, can you create a composite ID where one of the columns you are mapping to the ID can have null values? This is to deal with a legacy table that has a unique key which can have null ...
user avatar
1 vote
5 answers
6k views

In Hibernate we have two classes with the following classes with JPA mapping: package com.example.hibernate import javax.persistence.Entity; import javax.persistence.FetchType; import javax....
talg's user avatar
  • 1,779
37 votes
7 answers
74k views

I'm trying to get only the list of id of object bob for example instead of the list of bob. It's ok with a HQL request, but I would know if it's possible using criteria ? An example : final ...
user avatar
79 votes
8 answers
113k views

I'm trying to do a basic "OR" on three fields using a hibernate criteria query. Example class Whatever{ string name; string address; string phoneNumber; } I'd like to build a criteria query where ...
ScArcher2's user avatar
  • 87.5k
9 votes
2 answers
11k views

What are the steps required to enable Hibernate's second-level cache, when using the Java Persistence API (annotated entities)? How do I check that it's working? I'm using JBoss 4.2.2.GA. From the ...
Peter Hilton's user avatar
  • 17.4k
1 vote
2 answers
1k views

I have a one to many relationship between two tables. The many table contains a clob column. The clob column looks like this in hibernate: @CollectionOfElements(fetch = EAGER) @JoinTable(name = ...
SCdF's user avatar
  • 59.7k
0 votes
2 answers
2k views

In my database, I have an entity table (let's call it Entity). Each entity can have a number of entity types, and the set of entity types is static. Therefore, there is a connecting table that ...
Yuval's user avatar
  • 8,117
13 votes
6 answers
31k views

@Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) public class Problem { @ManyToOne private Person person; } @Entity @DiscriminatorValue("UP") public class UglyProblem extends ...
Georgy Bolyuba's user avatar
8 votes
3 answers
8k views

I am using Hibernate in a Java application to access my Database and it works pretty well with MS-SQL and MySQL. But some of the data I have to show on some forms has to come from Text files, and by ...
Fernando Barrocal's user avatar
2 votes
2 answers
3k views

Is there any way to save an object using Hibernate if there is already an object using that identifier loaded into the session? Doing session.contains(obj) seems to only return true if the session ...
qwerty's user avatar
  • 535

1
1899 1900 1901 1902
1903