-->
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.  [ 2 posts ] 
Author Message
 Post subject: Not evaluated @Column Annotation
PostPosted: Tue Apr 08, 2008 11:53 am 
Newbie

Joined: Tue Apr 08, 2008 11:38 am
Posts: 1
Hallo,

Ich benutze SEAM 2.0.1 in JBoss 4.2.2 mit EJB3 und PostgreSQL 8.2.6. Hibernate ist in Version 3.2.1 im Spiel. Aus dem SEAM-Forum wurde ich hierher verwiesen.

Ich habe ein Entity-Bean mit einem Feld physicalDiskId mittels der Column-Annotation auf eine Spalte physicalvolume_id abgebildet. Hier ein Auszug aus dem Quelltext:


Code:
@Entity
@IdClass(ExtentPK.class)
@Table(name="extent")
public class Extent implements java.io.Serializable {
   
   private static final long serialVersionUID = 1L;

   // <editor-fold defaultstate="collapsed" desc="EJB CMP Fields.">
    @Id
    @Column(name = "id", nullable = false)
    private Long id;
   
    @Id
    @Column(name = "physicalvolume_id", nullable = false)
    private Long physicalDiskId;
   
    @Column(name="virtualposition")
    private Long virtualPosition;
   
    @Column(name="physicalposition")
    private Long physicalPosition;
   
    @Column(name="status")
    private Long status;
   
    @Column(name="virtualvolume_id")
    private Long virtualVolumeId;

[...]


Beim versuch die Anwendung im JBoss zu starten erhalte ich folgenden Fehler:

Code:
15:37:13,075 WARN  [ServiceController] Problem starting service persistence.units:ear=mda2008.ear,jar=mda2008.jar,unitName=mda2008
javax.persistence.PersistenceException: org.hibernate.HibernateException: Missing column: physicalDiskId in public.extent
   at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:720)
   at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)


Hibernate scheint also meine Angabe über den Namen der Spalte zu ignorieren. Was habe ich falsch gemacht?

Die Tabelle extent sieht wie folgt aus:

Code:
CREATE TABLE extent (
        id bigint,
        physicalvolume_id bigint,
        virtualposition bigint,
        physicalposition bigint,
        status bigint,
        virtualvolume_id bigint,
        PRIMARY KEY (id, physicalvolume_id)
);



danke im Vorfeld,

Sascha


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 21, 2008 4:59 pm 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
sehr komisch, es sollte eigentlich gehen.

Versuche mal ein Beispiel nur eine Klasse und nur die Composite ID zu erstellen und das Problem zu isolieren.

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


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

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.