[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Can I use a ROWID column as a primary key?

In general I would not recommend trying to use a ROWID as a primary key. 
Although I'm not sure why your example is not working, it seems JDBC does
not like to ROWID being bound back.  You may wish to experiment with raw
JDBC to find something that will work, then try configuring that in
EclipseLink.  You may be able to map to the attributes of the XML document
and declare one of those as the primary key.  You could also try defining
the XMLType as the primary key, although you would still not be able to
update it.

EclipseLink does support the Oracle XMLType, but only as a column type, not
as a table.  You may wish to log this enhancement request.  Do you intend to
map the XML to an object, or do you just want the XML?  I would recommend
you add a normal table that has a generated sequence id and a column for the
XMLType.


dmitryerkin wrote:
> 
> Hi
> I mean can I use a ROWID column as a primary key instead of real column
> which is sequenced in case I have not a primary key column in my table?
> I work with xmldb object tables so I can not add extra columns.
> Is it possible to retrieve into a bean's attribute the value of ROWID for
> the record which was inserted while executing of the EntityManager's flush
> method?
> I use Oracle DB of course.
> 
> 
> Maybe I can implement a custom stored procedure which returns a ROWID
> value ane set this procedure by
> descriptor.getQueryManager().setInsertCall?
> 
> Regards
> Dmitry
> 


-----
---
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/Can-I-use-a-ROWID-column-as-a-primary-key--tp18980847p18981603.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.