Hi,
(I have no experience with Hazelcast and just had a quick look in their docs to find out about the portable serialization, so take the following with a grain of salt).
As you say, Hibernate OGM uses a generic contract centered around a tuple-like representation of your data. So what won't work is to let your actual domain objects implement Portable because you will not get hold of these objects from within your dialect implementation.
But a dialect may decide to persist the passed tuples in whatever way it likes, it doesn't have to be the direct tuple representation. So one way may be to create a PortableTuple (implements Portable) class and persist such objects based on the tuples passed to insertTuple(). Your TupleSnapshot implementation would wrap such PortableTuple when reading data.
That'd still be a generic representation (basically storing the tuple column name array and the tuple column value array), I guess it's not really idiomatic and not ideal for querying. So you may try to implement PortableTuple in a way that it writes out the actual column values, but that'd require to know the persisted structure during read back; I'm not sure how that could be done (apart from encoding that structure somehow at the beginning of the record). Alternatively, you'd need to have one XyPortableTuple type for each entity type which may be doable by generating these classes upon start-up based on the registered entity types.
Hth,
--Gunnar
_________________ Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/
|