Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: Re[eclipselink-users] mote LOB (database link)

You can map a class to a view the same as a table, just give the view name
instead of the table name.

If you wish to update the table instead of the view, you can use a
DescriptorCustomizer to set the insertSQLString, updateSQLString and
deleteSQLString or Query on your ClassDescriptor DescriptorQueryManager
(i.e. descriptor.getQueryManager().setInsertSQLString("insert into FOO (BAR)
values (#BAR)")

You may also be able to configure you view to use triggers for the
insert/update in the database.


swillcox wrote:
> 
> I have a remote table (using a database link) that contains a LOB column
> and all is working except in Oracle you can't read (select) from a LOB
> from a remote database or you get error ORA-22992: cannot use LOB locators
> selected from remote tables.
> 
> So a workaround is to create a view on the remote database such as:
> create or replace view v 
> as 
>   select col_a, col_b, dbms_lob.substr(lob_col,32767,1) lob_col from
> text_value;
> 
> and now you can do a select from the linked from database.
> 
> So, my question is how do you map a java class to a view for just reading
> but have the java class use the normal table mapping for insert, updates,
> and deletes (since I've yet to figure out how to insert into this view
> without getting ORA-01733: virtual column not allowed here). 
> 


-----
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/Remote-LOB-%28database-link%29-tp23643441p23724205.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top