Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] ManyToMany join table with an id

It depends on how you want the id assigned.  If the database assigns the
value through an IDENTITY column, or trigger, then it will be fine.  If you
want JPA or your application to assign the id, then you need to create a
class for the join table.

You might also be able to assign the id, using custom SQL in the EclipseLink
mapping using a DescriptorCustomizer (mapping.setInsertSQLString()).



Jaka Jančar wrote:
> 
> Is it possible to use a join table with an id for a ManyToMany
> relationship (e.g., a table with columns id, aId, bId), without
> defining an entity for it's rows?
> 


-----
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://www.nabble.com/ManyToMany-join-table-with-an-id-tp23658002p23724389.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top