Questions tagged [hibernate-4.x]

Represents the 4.x release of the Hibernate Object/Relational Mapping project

302 questions
0
votes
1 answer

why use of hibernatetemplates is eliminated from spring 3.1 on wards?

we are starting a new project and in a confusion whether we can use hibernatetemplates or not. But in many of forums found, use of hibernatetemplates is eliminated from spring 3.1+ on wards. Can any one please provide why hibernatetemplate was…
Pand005
  • 1,095
  • 3
  • 23
  • 53
0
votes
1 answer

javax.persistence.PersistenceException in Hibernate

I have generated POJO's and corresponding hbm.xml mapping files from a database. I wanted to test whether this worked correctly so I created a simple HelloWorld that reads all the data in one Table and prints it. When I attempt to run this, a…
diestl
  • 2,020
  • 4
  • 23
  • 37
0
votes
1 answer

Hibernate 4 + Spring 3.2 + Transaction Manager + No Roll Back in Mysql

I need some help. I'm have a problem with a transaction with hibernate and spring. I'm trying to fill up a File table in mysql. My first insert works great, the second doesn't work (but it's normal...). But data from the frist insert are still…
ZheFrench
  • 1,164
  • 3
  • 22
  • 46
0
votes
1 answer

Enumerate and change persistent fields in a generic (indirect) manner

In Hibernate 4.x, is there any way to get a list of persistent fields at runtime? By persistent fields I don't mean DB column names, but POJO field names or property names (depending on access type for a particular entity). Also, is there a method…
Boris B.
  • 4,933
  • 1
  • 28
  • 59
0
votes
1 answer

OneToMany - org.hibernate.AnnotationException: mappedBy reference an unknown target entity property

I'm trying to generate the DB schema from my domain classes using the hibernate-tools.jar bundled in OpenXava. Unfortunately, two classes with a OneToMany association are causing me troubles. This is the first one: @Entity public class Deceased…
iccuta
  • 165
  • 1
  • 13
0
votes
2 answers

Issues with my criteria query when calling SQL created function

In my Postgres 9.1 database I have a li table that is mapped by ORM (Hibernate) in the following Li class: package a.b; @Entity @Table(name = "li", schema = "public") @TypeDef(name="inet", typeClass=InetType.class) public class…
artaxerxe
  • 6,281
  • 21
  • 68
  • 106
0
votes
2 answers

How to mark Hibernate bean property as @Transient on Java 6?

I have an application that I am being forced to host on a provider that only runs JRE 6. I get a compilation error on my Hibernate beans that have properties that have been annotated with @Transient. The compilation error is due to the fact that…
maple_shaft
  • 10,435
  • 6
  • 46
  • 74
0
votes
1 answer

Join many tables in to the map

I have 3 tables: user, role, project. In addition, I created a table that links them all together and has the structure like this: id, id_user, id_role, id_project. I would like, using annotation, in the user class, create a map: Map
Marcin
  • 508
  • 2
  • 10
  • 28
0
votes
3 answers

hibernate4, spring 3: No Session found for current thread

I've seen several similar questions, but none of the suggested solutions helped me. Detail, it's a simple exemple : File: MandatTypeBean.xml
user2212094
  • 5
  • 1
  • 3
0
votes
1 answer

Hibernate ManyToMany same JoinColumn name

I have two entity classes Activity and User. The relationships between them are: One Activity can have one or many User One User can belongs to one or many Activity So to achieve this I have defined @ManyToMany mapping between them. Below is my…
Tapas Bose
  • 28,796
  • 74
  • 215
  • 331
0
votes
1 answer

config setup in integration test after migration to Hibernate 4

I have config class public class HibernateConfiguration { private HibernateConfiguration() {} public Configuration configuration(Class clazz) { Configuration c = new Configuration(); c.setProperty(Environment.DRIVER,…
vector
  • 7,334
  • 8
  • 52
  • 80
0
votes
1 answer

No Session found for current thread (HIBERNATE)

OK JAVA guru )) I really new to spring and I got into this trouble with "No session found the current thread" when I refer to the following page JSP security after login. Up to this point everything is working. I need your help guys!!!!! Here is my…
Valknut
  • 1,010
  • 2
  • 15
  • 19
0
votes
1 answer

Selecting multiple sums HQL

If i run the query below I get a list of Objects that I cant cast to Long String queryString = "select sum(cat.varaible1), sum(cat.varaible2) from Enrollment as cat where cat.created >= :startDate and cat.created <= :endDate"; If I remove…
pethel
  • 5,397
  • 12
  • 55
  • 86
0
votes
1 answer

Criterion restrictions on objects

This code is not valid but is it possible to this in a different way. I would like to use the String regnumber in the Car object in the Person object. public class Person(){ Car car; } public class Car(){ String regnumber; } Criteria…
pethel
  • 5,397
  • 12
  • 55
  • 86
0
votes
0 answers

How to get a unique key for two fields with Hibernate 4.1.9.Final?

I have 2 classes, StockNDate and Datapoint. StockNDate is an embedded entity that I've put into DataPoint. I'd like to set it up so that there can only be one Datapoint with one StockNDate. I tried using a @Column annotation, but that doesn't…
HappyCoder86
  • 2,267
  • 3
  • 25
  • 40