Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] mapping problem in O2O relation

Join columns can only map to id fields. You want want to vote for the following bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=224634

In the mean time, either use the id field from DBObjekt or specify a customizer to modify your one to one mapping from Log to map to the non id field.

Cheers,
Guy

On 13/07/2010 5:37 AM, Steffen Förster wrote:

Hello there,

my EclipseLink tries to use the wrong Column.

The details:

@Entity

@Table(name=”DBOBJECTS”)

@DiscriminatorColumn(name="CLASSNAME")

@Inheritance(strategy=InheritanceType.JOINED)

public class DBObjekt

      .. some members ..

}

@Entity

@Table(name="USER")

@DiscriminatorValue(value="USER")

public class User extends DBObjekt{

      private String username;

}

 

@Entity

@Table(name="LOG")

public class Log{

      @OneToOne(optional=true)

        @JoinColumn(name="USERNAME",referencedColumnName="USERNAME",nullable=true,insertable=false)

      private User user = null;

      .. some members ..

 

Now the problem: If I try to persist a Log Entry EL throws a DescriptorException because it‘s searching for the column DBOBJECTS.username but the information is stored in USER.username. What’s wrong with my mapping? Thanks for your help.

 

 

With kind regards

 

Steffen Förster

 


N+P Informationssysteme GmbH

Steffen Förster

Softwareentwicklung
An der Hohen Straße 1
08393 Meerane

 

Tel.:      +49 3764 4000-0
Fax:      +49 3764 4000-40

 

Geschäftsstelle Dresden

Tel.: +49 351 8471131-0

 

Geschäftsstelle München

Tel: +49 89 452298-30

 

Geschäftsstelle Nürnberg

Tel.: +49 911 72305-70

 

Geschäftsführer: Jens Hertwig

HRB 1746 Chemnitz

 

www.nupis.de

www.spartacus-fm.de


 

 


_______________________________________________ eclipselink-users mailing list eclipselink-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/eclipselink-users

Back to the top