Skip to main content

[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

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

--- James Sutherland
 EclipseLink ,
Wiki: EclipseLink , TopLink 
Forums: TopLink , EclipseLink 
Book: Java Persistence 
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

Back to the top