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

Move "insertPostProcessing" from MappingCallbacks to own interface, also for updates #365

Closed
andyjefferson opened this issue Mar 11, 2021 · 0 comments
Milestone

Comments

@andyjefferson
Copy link
Member

andyjefferson commented Mar 11, 2021

Whether a column needs any post processing after an INSERT (or an UPDATE too for that matter) really ought to be implemented by the ColumnMapping, but also defined on the JavaTypeMapping. Currently it is dumped onto MappingCallbacks even though it is unlike the other handling on MappingCallbacks (relationships etc).

Consequently we could create 2 interfaces

public interface ColumnMappingPostInsert
{
    void insertPostProcessing(Object value);
}
public interface ColumnMappingPostUpdate
{
    void updatePostProcessing(Object value);
}

Similarly the owning JavaTypeMapping would need to implement something similar, since that is the only place that can provide the value for each ColumnMapping (e.g jts.GeometryMapping, OracleSerialisedPCMapping) and any XXXColumnMapping that requires to perform post processing after an INSERT or UPDATE should implement whichever it needs. The arguments passed in to these methods may need expanding as we come across use-cases.

Prime example of this requirement is the Oracle CLOB/BLOB handling. Potentially usable for PostgreSQL "large object" feature.

We then need to modify InsertRequest and UpdateRequest to put in calls to all affected columns that are INSERTed or UPDATEd.

Affected JavaTypeMapping classes are
geospatial : jts/GeometryMapping
rdbms : OracleBitSetMapping, OracleSerialisedObjectMapping, OracleSerialisedPCMapping, OracleStringLobMapping

Affected ColumnMapping classes are
rdbms : OracleBlobColumnMapping, OracleClobColumnMapping,

@andyjefferson andyjefferson changed the title Move "insertPostProcessing" from MappingCallbacks to own interface, and on ColumnMapping Move "insertPostProcessing" from MappingCallbacks to own interface, same for "updatePostProcessing" Mar 11, 2021
@andyjefferson andyjefferson changed the title Move "insertPostProcessing" from MappingCallbacks to own interface, same for "updatePostProcessing" Move "insertPostProcessing" from MappingCallbacks to own interface, also for updates Jun 28, 2021
@andyjefferson andyjefferson added this to the 6.0.0.m2 milestone Jun 28, 2021
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