Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] DDL Generation for

The foreign key constraint should be defined, please log a bug for this.

The primary key constraint cannot be defined, as there is some level of
support for duplicates in an ElementCollection.  But, if you have defined a
unique constraint, or use a Set, then it should probably get defined,
include this in the bug.

For now you can just create or alter the table with your own DDL.  The auto
generated tables are mainly for prototyping, so do not support everything
that you may wish to define in a production schema.



meetoblivion wrote:
> 
> So I'm just wondering about DDL generation in EclipseLink.
> 
> I'm using a simple Entity with List of String as a child table.  Based on
> what I've read, this is generally defined by an ERD as
> 
> PK, FK1 ENTITY_ID
> PK         STRING_VALUE
> 
> This is the exact mapping I've defined
> 
>  @ElementCollection
> 
> @CollectionTable(name="INSTANCE_JOB_CODE_ACCESS",joinColumns=@JoinColumn(name="SCORECARD_INSTANCE_ID"),schema="SCORECARD")
>  @Column(name="JOB_CODE")
>     private List<String> instanceJobCodesAccess = Lists.newArrayList();
> 
> Now, I can make it a unique constraint in the CollectionTable, however,
> I'm
> wondering if there's someway I can force it to generate the foreign key
> constraint as well as the primary key, as this does not get generated.
> 
> Thanks!
> 
> John
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://old.nabble.com/DDL-Generation-for-tp27070052p27129166.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top