Bug 289 : DDL generating duplicate columns with Embedded foreign key
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.6.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
02/05/2010
Updated 
02/05/2010
Type 
Bug
 
Attachments 
No attachments

We found a problem with the DDL created by ebean where insertable=false and updatable=false.

See the attached test classes for an example that will fail, it created this sql for the Order class:

create table orders (
company varchar(255),
order_number integer,
customerName varchar(255),
customerName varchar(255),
item varchar(255),
constraint pk_orders primary key (company, order_number)
)

 
Rob 02 May 09:20
And the relevant part of the model ...
...
@Entity
@Table(name="orders")
public class ROrder {

    @EmbeddedId
    protected ROrderPK orderPK;

    @ManyToOne(cascade=CascadeType.ALL)
    @JoinColumns({
        @JoinColumn(name="company", referencedColumnName="company", insertable=false, updatable=false),
        @JoinColumn(name="customerName", referencedColumnName="name", insertable=false, updatable=false)
    })
    private RCustomer customer;

    @Column(name="customerName")
    private String customerName;

...

Rob 02 May 09:23
Fixed in HEAD.

Fixed in HEAD.

woResponse

Upload a file