Dan, Rob?

In the SQL object store AbstractJdbcFieldMapping, the method
"public void initializeField(ObjectAdapter object, Results rs)"
explicitly converts the record set field into a string, then uses
"field.getSpecification().getFacet(EncodableFacet.class).fromEncodedString(valueString)"
to create an object adapter from the string.

This is quite messy and obviously will kill anything like a BLOB (e.g. an
image!)

How do I directly create (for example) an ObjectAdapter containing an Isis
applib Date value, to pass on to
"((OneToOneAssociation) field).initAssociation(object, restoredValue);"

I guess the real requirement is creating the ObjectAdapter (for the
retrieved value object) to pass on to "initAssociation".

The same would go for the other values (e.g. Image), and extend to custom
written value types (ValueSemanticsProvider? but I see that being handled
by an AbstractJdbcFieldMapping class implementation).

In short - I am trying to move away from fetching/storing properties as
strings. This started with recoding the Sql object store to use prepared
statements with inserted objects (e.g. WHERE value = ?) instead of (WHERE
value = 'zorkmid').

Regards,
Kevin


Reply via email to