-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Could not determine type for: java.util.List
PostPosted: Thu Oct 25, 2007 10:48 am 
Newbie

Joined: Sat Aug 25, 2007 5:36 am
Posts: 7
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3

Mapping documents:

Code between sessionFactory.openSession() and session.close():
Query query = session.getNamedQuery(Lecture.FIND_ALL_LECTURES);
List lectures = query.list();
trx.commit();


Full stack trace of any exception that occurs:
Code:
org.hibernate.MappingException: Could not determine type for: java.util.List, for columns: [org.hibernate.mapping.Column(appointments)]
   at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266)
   at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
   at org.hibernate.mapping.Property.isValid(Property.java:185)
   at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:440)
   at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
   at org.hibernate.cfg.Configuration.validate(Configuration.java:1102)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1287)
   at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
   at beans.organisation.db.OrganisationManagementDaoBean.beginSession(OrganisationManagementDaoBean.java:47)
   at beans.organisation.db.OrganisationManagementDaoBean.findAllLectures(OrganisationManagementDaoBean.java:338)
   at beans.organisation.OrganisationManagementBean.findAllLectures(OrganisationManagementBean.java:421)
   at ceTest.organisation.LectureOrganisationManagementTest.testFindAllLectures(LectureOrganisationManagementTest.java:63)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
   at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
   at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
   at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
   at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
   at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
   at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
   at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
   at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
   at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
   at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
   at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)


Name and version of the database you are using: Postgres 8

Hi,

ich habe folgendes Problem.
Ich bekomme den oben genannten Fehler.
Ich weiß aber nicht warum.
Die beiden betroffenen Klassen sind Lecture und Appointment.
Hier der Mapping Ausschnitt aus Lecture:
Code:
   
@OneToMany(fetch=FetchType.LAZY, mappedBy="lecture")
private List<Appointment> appointments = new ArrayList<Appointment>(0);


Hier der Mapping Ausschnitt aus Appoitnment:
Code:
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="lecture", nullable=false)
private Lecture lecture;


Die NamedQuery für FIND_ALL_LECTURES sieht wiefolgt aus:
Code:
FROM Lecture


Woher kann dieser Fehler kommen?
Bei allen andern OneToMany Mappings (auch als List) funktioniert es.

Danke im Voraus.

Gruß


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.