/** * INTERNAL: */ public void setDirectKeyField(DatabaseField keyField) { getDirectMapUsableContainerPolicy().setKeyField(keyField, descriptor); }
/** * PUBLIC: * Set the converter on the mapping. * A converter can be used to convert between the key's object value and database value. */ public void setKeyConverter(Converter keyConverter) { getDirectMapUsableContainerPolicy().setKeyConverter(keyConverter, this); }
/** * INTERNAL: * Set the converter class name on the mapping. Initialized in * convertClassNamesToClasses. * A converter can be used to convert between the key's object value and database value. */ public void setKeyConverterClassName(String keyConverterClassName) { getDirectMapUsableContainerPolicy().setKeyConverterClassName(keyConverterClassName, this); }
/** * PUBLIC: * Return the converter on the mapping. * A converter can be used to convert between the key's object value and database value. */ public Converter getKeyConverter() { return getDirectMapUsableContainerPolicy().getKeyConverter(); }
/** * INTERNAL: */ public DatabaseField getDirectKeyField() { return getDirectMapUsableContainerPolicy().getDirectKeyField(null); }
/** * INTERNAL: * Compare the attributes belonging to this mapping for the objects. */ public boolean compareObjects(Object firstObject, Object secondObject, AbstractSession session) { Object firstObjectMap = getRealCollectionAttributeValueFromObject(firstObject, session); Object secondObjectMap = getRealCollectionAttributeValueFromObject(secondObject, session); DirectMapUsableContainerPolicy mapContainerPolicy = getDirectMapUsableContainerPolicy(); return mapContainerPolicy.compareContainers(firstObjectMap, secondObjectMap); }
/** * INTERNAL: * Initialize and validate the mapping properties. */ public void initialize(AbstractSession session) throws DescriptorException { getDirectMapUsableContainerPolicy().setDescriptorForKeyMapping(this.getDescriptor()); super.initialize(session); getDirectMapUsableContainerPolicy().setValueField(directField, valueConverter); if (getValueConverter() != null) { getValueConverter().initialize(this, session); } }
Object referenceKey = null; if (query.isObjectBuildingQuery()){ referenceKey = getDirectMapUsableContainerPolicy().buildKey(databaseRow, (ObjectBuildingQuery)query, session); } else { referenceKey = getDirectMapUsableContainerPolicy().buildKey(databaseRow, null, session);