Extended loggable to use types for values

This should fix issue #986.
Sorry for the long response time, i was on vacation. I will rework this and would name the method "convertToDatabaseValue" or has you a other suggestion.