Persist data when the table was not mapped (JPA EclipseLink)

Posted by enrique on Stack Overflow See other posts from Stack Overflow or by enrique
Published on 2010-05-26T17:14:11Z Indexed on 2010/05/29 21:02 UTC
Read the original article Hit count: 172

Filed under:
|
|
|
|

Hi everybody

I need some help in persisting data into a table that has not been mapped...

The issue is that the database we have has a table which all of its columns are foreign keys so by mapping the whole database all of the tables are correctly mapped. However that table called "category" is not mapped. The way in which we can browse the data is by passing for the table I mentioned using the @jointable annotation which was set by the system in the other tables with which "category" has a relation.

So we can go ahead and using the collections and perform a query. But the issue comes when I want to persist data into that table because there´s no any entity.

We tried to persist through the collections but no luck. Then I have just tried by creating the entity with its PK and Facade all by hand. However when I try to persist using the Merge method the system tries to perform an Insert when it is supposed to perform an Update. So obviously it returns an error.

Does anybody have an idea on this situation?

Thanks.-

© Stack Overflow or respective owner

Related posts about java

Related posts about Oracle