geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MarWestermann <MarWesterm...@gmx.de>
Subject Exception in using: @OneToMany with mappedBy
Date Tue, 07 Oct 2008 21:42:34 GMT

Hi,

I have a question and I can't find the answer.
geronimo: 2.1.3
Java: 1.5.07 SE

I have some entities, where all the annotations are defined before the
getter-method. Some of the entities have a one-to-many relationship. But
when I use the mappedBy option, I get the following exception:

<openjpa-1.0.3-r420667:677674 nonfatal user error>
org.apache.openjpa.util.UserException: Type
"org.intersales.qsactive.helpdesk.ebeans.Supportcase" attempts to use both
field and property access. Only one access method is permitted.

Here comes an example:
First the class wich throws the exception:

@Entity
@Table(name="supportcase")
public class Supportcase implements Serializable {

private int key;
private Collection<Customer>;
...
@Id
public int getKey() ...

@OneToMany(mappedBy="supportcase")
public Collection<Customer> getCustomer()...
}

now the Customer-Class
@Entity
@Table(name=customer)
public class Customer implements Serializable {

private int key;
private Supportcase supportcase;

@Id
public int getKey()...

@ManyToOne
public Supportcase getSupportCase()...


I think the problem is, that I use a field-access due to the mappedBy-Option
while the other settings are all made on the getter-methods. When I delete
the mappedBy-keywords, I don't get any exceptions (but for every relation
there is a mapping-table created)

Any advices?

Thanks Marco
-- 
View this message in context: http://www.nabble.com/Exception-in-using%3A-%40OneToMany-with-mappedBy-tp19867956s134p19867956.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message