Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Indexing the FK of a table generated for an element collection ?

Thanks Guy, this that didnt work.  I'm assuming it doesnt maybe since the annotation lives in the entity class but the index actually needs to be on the table that is generated for the collection and not the entity itself.  I was thinking maybe it needed to be part of a join column annotation but wasnt able to see how to get it in there.  Any other ideas?

Thanks again
- Phillip


On Thu, Feb 7, 2013 at 10:04 AM, Guy Pelletier <guy.pelletier@xxxxxxxxxx> wrote:
Hi Philip,

Does this not work?

@ElementCollection
@OrderColumn
@Index(columnNames={FK_NAME})
private List<String> details.

Cheers,
Guy

On 06/02/2013 8:22 PM, Phillip Ross wrote:
Hi all,

I have a quick question regarding DDL generation of indexes for element collections.

I have a class in which exists a property which is a list of strings, and is annotated with element collection.  The declaration is simply as follows:

@ElementCollection
@OrderColumn
private List<String> details;

When the DDL is generated, a details table is created with a FK pointing back to the table corresponding to the class containing the list property.  There's not a separate class for the elements of the embedded collection for me to annotate with @Indexes/@Index annotation... since the type is String.  Is there a way to annotate something else to have DDL generation create the index on the FK of the embedded collection table or will I have to do this manually?

Thanks!
- Phillip


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

--

Oracle
Guy Pelletier

ORACLE Canada, 45 O'Connor Street Suite 400 Ottawa, Ontario Canada K1P 1A4

Green
            Oracle Oracle is committed to developing practices and products that help protect the environment


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



Back to the top