Add custom type support

Description

None

Environment

None

Activity

Show:
Emmanuel Bernard
March 6, 2015, 1:50 PM

Unfortunately, I have not spent time thinking about it.
Here is what pops to mind.

We can offer the JPA 2.1 level support (AttributeConverter) which essentially remains a simple object to object bidirectional conversion.
In this case the converted type should go to the regular dialect type conversion logic? (say a custom type is converted into a URL)

We can also offer something intermediary by exposing Tuple + metadata. Compared to the JPA 2 converter, you can write several columns for one given property. Say a Amount can be stored in two columns, price and currency.

The last I can think of is exposing dialect specific APIs (say the mongo command to execute). but that's 1. specific to the nosql targeted and 2. not sure we can do something clean enough.

I would focus on 1 then 2 initially.

Emmanuel Bernard
March 20, 2015, 8:10 AM
Edited

For the super extra flexible option, consider the use case explained here
https://forum.hibernate.org/viewtopic.php?f=31&t=1038713&p=2483701#p2483701

(i.e. support GridFS)

Emmanuel Bernard
March 20, 2015, 8:14 AM
Emmanuel Bernard
January 6, 2016, 9:48 AM

A comment from a year ago mentions another alternative: expose the JDBC statement API as we already do Statement to Tuple. But that's unclear what more flexibility it bring us. (from OGM-525)

Emmanuel Bernard
January 6, 2016, 7:37 PM

JPA AttributeConverter is implemented at OGM-952.

Assignee

Unassigned

Reporter

Emmanuel Bernard

Labels

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

Yes, likely

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Priority

Major
Configure