Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oracle : support writing BLOB columns in join tables #14

Open
andyjefferson opened this issue Apr 11, 2016 · 1 comment
Open

Oracle : support writing BLOB columns in join tables #14

andyjefferson opened this issue Apr 11, 2016 · 1 comment

Comments

@andyjefferson
Copy link
Member

andyjefferson commented Apr 11, 2016

Oracle (for storing large amounts of data, offline, in a BLOB column) requires some whacky process of inserting EMPTY_BLOB() on an INSERT and then retrieving and setting the actual value of the BLOB field. This is only implemented for tables of classes currently, and not for join tables.

v6.0 updates means that we have OracleCollectionMapping and the element mapping would be such as OracleBlobColumnMapping (in the join table). The add element of the backing store fires off any INSERT (or UPDATE if it was to do one). This would need to call mapping.performSetPostProcessing(...).

The difficult part of this is tied to OracleBlobColumnMapping.setPostProcessing (and equivalent Clob method). This needs to do
SELECT {blob} FROM join_tbl WHERE ID = ?
but with a join table we don't have an "id", we have the owner, but that only restricts to all elements of the collection. We also (may, with an indexed List) have an index column. We need to restrict to a particular element of the collection (or particular key/value of the map).

Note that we could allow a BLOB to store less than 4k bytes (?) by just putting the value into the INSERT statement, but why use a BLOB in that case?

@andyjefferson
Copy link
Member Author

Sample test that shows a simple field persisted as CLOB (passes), Collection field persisted (serialised) as BLOB (passes), and Collection field persisted into JOIN table with CLOB element (fails).
test.zip

andyjefferson added a commit that referenced this issue Jun 28, 2021
update post processing into setPostProcessing(...) on JavaTypeMapping,
and add specific callback in UpdateRequest rather than just dumping it
into postUpdate. Remove MappingCallbacks from some of the Oracle type
mappings that don't need any actual relationship management (what
MappingCallbacks is intended for). Add placeholder for setPostProcessing
on OracleCollection/OracleMap/OracleArray for when we want to handle
BLOB/CLOB in a join table (#14).
Fixes #365.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant