module SdbDal class StartsWithCondition attr_accessor :attribute_description attr_accessor :value def initialize(attribute_description,value) self.attribute_description=attribute_description self.value=value end def matches?(domain_object) if domain_object[attribute_description.name]==nil return value==nil || value==:NULL end return domain_object[attribute_description.name].index(value)==0 end def to_sdb_query return "'#{self.attribute_description.name}' starts-with '#{self.attribute_description.format_for_sdb(self.value)}'" end end end