[ 
https://issues.apache.org/jira/browse/OPENJPA-1607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971565#action_12971565
 ] 

Maurice Bernards edited comment on OPENJPA-1607 at 12/15/10 2:02 AM:
---------------------------------------------------------------------

Hi,

I got the same problem.
I have defined the following:

@OneToMany
@JoinColumn(name = "proj_id")
private Collection<Task> tasks = new ArrayList<Task>();

When I deploy my application on a glassfish server, it is working. The 
deployment is correct, no jointables are created as expected.

To ensure quality, I'm writing tests for it using OpenEJB.
I'm currently using openejb-standalone-3.2-20100914.180618-7 and replaced the 
openjpa with this one: apache-openjpa-2.2.0-20101211.065431-6-binary

When I run the tests, I get the error message on every One-To-Many 
unidirectional relationship:

You have supplied columns for "vilauta.entity.Project.tasks", but this mapping 
cannot have columns in this context.

Entities which do not contain an unidirectional One-To-Many field, run without 
a problem.

      was (Author: sagittarius):
    Hi,

I got the same problem.
I have defined the following:

@OneToMany
@JoinColumn(name = "proj_id")
private Collection<Task> tasks = new ArrayList<Task>();

When I deploy my application on a glassfish server, it is working. The 
deployment is correct, no jointables are created as expected.

To ensure quality, I'm writing tests for it using OpenEJB.
I'm currently using openejb-standalone-3.2-20100914.180618-7 and replaced the 
openjpa with this one: apache-openjpa-2.2.0-20101211.065431-6-binary

When I run the tests, I get the error message on every One-To-Many 
unidirectional relationship:

You have supplied columns for "vilauta.entity.Project.tasks", but this mapping 
cannot have columns in this context.

Entity which contain no unidirectional One-To-Many fields, run without a 
problem.
  
> Using unidirectional one-to-many target foreign key throws exception
> --------------------------------------------------------------------
>
>                 Key: OPENJPA-1607
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1607
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.0.0-beta3
>            Reporter: Oliver Ringel
>         Attachments: openjpa-1607.tar
>
>
> Using this simple unidirectional relationship
> @OneToMany
> @JoinColumn(name = "DEPARTMENT_ID")
> private Set<Employee> employees;
> causes to the following exception
> <openjpa-2.0.0-beta3-r422266:926797 fatal user error> 
> org.apache.openjpa.persistence.ArgumentException: You have supplied columns 
> for "com.example.Department.employees", but this mapping cannot have columns 
> in this context.
> Unidirectional one-to-many target foreign key relationship should be 
> supported in JPA 2.0.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to