Hi everyone,
I try to execute different queries on the hibernate-tutorial example (about Events and Persons).
I tried to execute the query "from Event, Person" with the 3.3.2.GA version of the hibernate-core - all right (Actually I get a cartesian product of two sets (all events and peoples)). So the text of the query is:
Code:
select
event0_.EVENT_ID as EVENT1_0_0_,
person1_.PERSON_ID as PERSON1_1_1_,
event0_.EVENT_DATE as EVENT2_0_0_,
event0_.title as title0_0_,
person1_.age as age1_1_,
person1_.firstname as firstname1_1_,
person1_.lastname as lastname1_1_
from
EVENTS event0_,
PERSON person1_
Then I changed the version of the hibernate-core to 3.5.0-Final or 3.6.0.Final in pom.xml and i got the query:
Code:
select
event0_.EVENT_ID as EVENT1_0_0_,
person1_.PERSON_ID as PERSON1_1_1_,
event0_.EVENT_DATE as EVENT2_0_0_,
event0_.title as title0_0_,
person1_.age as age1_1_,
person1_.firstname as firstname1_1_,
person1_.lastname as lastname1_1_
from
EVENTS event0_ cross
join
PERSON person1_
and ... unfortunately the error:
Code:
1878 [org.hibernate.tutorial.EventManager.main()] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: -28, SQLState: S0022
1878 [org.hibernate.tutorial.EventManager.main()] ERROR org.hibernate.util.JDBCExceptionReporter - Column not found: PERSON1_.PERSON_ID in statement ...
What can I do to fix this problem (I want use last version of hibernate-core)?
My pom.xml is:
Code:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.hibernate.tutorials</groupId>
<artifactId>hibernate-tutorial</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>First Hibernate Tutorial</name>
<build>
<!-- we dont want the version to be part of the generated war file name -->
<finalName>${artifactId}</finalName>
</build>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<!--version>3.3.2.GA</version-->
<version>3.6.0.Final</version>
</dependency>
<!-- Hibernate uses slf4j for logging, for our purposes here use the simple backend -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.1</version>
</dependency>
<!-- Hibernate gives you a choice of bytecode providers between cglib and javassist -->
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.8.0.GA</version>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.7</version>
</dependency>
</dependencies>
</project>
May be should I use another version of another libraries (for example hsqldb)?