-->
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: Zusammengesetzte PKs und ein seltsames Problem
PostPosted: Thu Jul 17, 2008 8:03 am 
Newbie

Joined: Thu Jul 17, 2008 7:49 am
Posts: 5
Hibernate version: Hibernate 3 (JBoss 4.2.2GA)

Full stack trace of any exception that occurs:

Quote:
13:41:02,490 WARN [ServiceController] Problem starting service persistence.units:ear=Projekt.ear,jar=ProjektEJB.jar,unitName=projekt03
org.hibernate.AnnotationException: Column name manrSuffix of xx.Mitarb not found in JoinColumns.referencedColumnName
at org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:306)
at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:64)
at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:428)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:286)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1233)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:154)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:869)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:407)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)
at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:246)
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.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:103)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)


Name and version of the database you are using: Oracle8i

Hi,

meine legacy Datenbank (die ich nicht aendern darf) hat einen komisch zusammengesetzten Primary Key, den ich nicht hinbekomme zu mappen (ich Newbie)

PK:

Code:
@Embeddable
public class MitarbPK implements Serializable {
   @Column(name="MANR", insertable=false, updatable=false)
   private Mitarbstamm manr;

   @Column(name="MANR_SUFFIX")
        // ich hab hier schon vieles als ausprobiert ...
   private int manrSuffix;


Entity:

Code:
@Entity
@IdClass(MitarbPK.class)
public class Mitarb implements Serializable {
   

   @Id
   @Column(name="MANR")
   private Mitarbstamm manr;   
   
   @Id
   @Column(name="MANR_SUFFIX")
   private int manrSuffix;   


ich hatte hier schon einiges an JoinColumn annotations dazugeschrieben aber nichts hilft - auch ueber EmbeddedId hab ich's schon versucht, es kommt irgendwie immer derselbe Fehler.

Letzten Endes ist es genau dasselbe Feld, Getter und Setter sind alle da, orm.xml und persistence.xml sind leer. manr meckert er nicht an komischerweise.


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.