Search in sources :

Example 1 with MappedRecord

use of jakarta.resource.cci.MappedRecord in project eclipselink by eclipse-ee4j.

the class OracleNoSQLPlatform method createInputRecord.

/**
 * Allow the platform to create the appropriate type of record for the interaction.
 * Convert the nested local mapped record to a flat global keyed record.
 */
@Override
public jakarta.resource.cci.Record createInputRecord(EISInteraction interaction, EISAccessor accessor) {
    if (interaction instanceof XMLInteraction) {
        return super.createInputRecord(interaction, accessor);
    }
    if (interaction instanceof MappedInteraction) {
        MappedRecord input = (MappedRecord) interaction.createInputRecord(accessor);
        // Create the key from the objects id.
        ClassDescriptor descriptor = interaction.getQuery().getDescriptor();
        if (descriptor == null) {
            if (getRecordConverter() != null) {
                return getRecordConverter().converterToAdapterRecord(input);
            }
            return input;
        }
        Object key = createMajorKey(descriptor, new EISMappedRecord(input, accessor), interaction, accessor);
        OracleNoSQLRecord record = new OracleNoSQLRecord();
        record.put(key, input);
        if (getRecordConverter() != null) {
            return getRecordConverter().converterToAdapterRecord(record);
        }
        return record;
    } else {
        return super.createInputRecord(interaction, accessor);
    }
}
Also used : OracleNoSQLRecord(org.eclipse.persistence.internal.nosql.adapters.nosql.OracleNoSQLRecord) MappedInteraction(org.eclipse.persistence.eis.interactions.MappedInteraction) ClassDescriptor(org.eclipse.persistence.descriptors.ClassDescriptor) EISMappedRecord(org.eclipse.persistence.eis.EISMappedRecord) XMLInteraction(org.eclipse.persistence.eis.interactions.XMLInteraction) EISMappedRecord(org.eclipse.persistence.eis.EISMappedRecord) MappedRecord(jakarta.resource.cci.MappedRecord)

Aggregations

MappedRecord (jakarta.resource.cci.MappedRecord)1 ClassDescriptor (org.eclipse.persistence.descriptors.ClassDescriptor)1 EISMappedRecord (org.eclipse.persistence.eis.EISMappedRecord)1 MappedInteraction (org.eclipse.persistence.eis.interactions.MappedInteraction)1 XMLInteraction (org.eclipse.persistence.eis.interactions.XMLInteraction)1 OracleNoSQLRecord (org.eclipse.persistence.internal.nosql.adapters.nosql.OracleNoSQLRecord)1